-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from OllieJC/add-softwire-allowed-users
Add Softwire as an allowed gds-users domain
- Loading branch information
Showing
10 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ class RemoveUserControllerTest < ActionDispatch::IntegrationTest | |
test 'should validate form' do | ||
post remove_user_url, params: { user_form: { email_list: '[email protected]' } } | ||
assert_response :success | ||
assert_select '.govuk-error-message', 'Error:Email list should be a list of GDS emails' | ||
assert_select '.govuk-error-message', 'Error:Email list should be a list of approved emails' | ||
end | ||
|
||
[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest | |
test 'should validate form' do | ||
post user_url, params: { user_form: { email_list: '[email protected]' } } | ||
assert_response :success | ||
assert_select '.govuk-error-message', 'Error:Email list should be a list of GDS emails' | ||
assert_select '.govuk-error-message', 'Error:Email list should be a list of approved emails' | ||
end | ||
|
||
[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
require 'test_helper' | ||
|
||
class EmailValidatorTest < ActiveSupport::TestCase | ||
test 'GDS email addresses are allowed' do | ||
test 'GDS email addresses are allowed to sign in' do | ||
email = '[email protected]' | ||
assert EmailValidator.email_is_allowed?(email) | ||
end | ||
|
||
test 'Cabinet Office email addresses are allowed' do | ||
test 'Cabinet Office email addresses are allowed to sign in' do | ||
email = '[email protected]' | ||
assert EmailValidator.email_is_allowed?(email) | ||
end | ||
|
||
test 'Softwire email addresses are not allowed to sign in' do | ||
email = '[email protected]' | ||
assert ! EmailValidator.email_is_allowed?(email) | ||
end | ||
|
||
test 'Other email addresses are not allowed to sign in' do | ||
email = '[email protected]' | ||
assert ! EmailValidator.email_is_allowed?(email) | ||
end | ||
|
||
test 'GDS emails are matched by the allowed emails regexp' do | ||
email = '[email protected]' | ||
assert_match EmailValidator.allowed_emails_regexp, email | ||
|
@@ -20,4 +30,14 @@ class EmailValidatorTest < ActiveSupport::TestCase | |
email = '[email protected]' | ||
assert_match EmailValidator.allowed_emails_regexp, email | ||
end | ||
|
||
test 'Softwire emails are matched by the allowed emails regexp' do | ||
email = '[email protected]' | ||
assert_match EmailValidator.allowed_emails_regexp, email | ||
end | ||
|
||
test 'Other email addresses should not match emails regexp' do | ||
email = '[email protected]' | ||
assert_no_match EmailValidator.allowed_emails_regexp, email | ||
end | ||
end |