-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FYST-1812 make email case insensitive for pya (#5600)
Co-authored-by: Drew Proebstel <[email protected]>
- Loading branch information
1 parent
19d2cfb
commit 594b9cf
Showing
4 changed files
with
26 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,12 @@ | |
|
||
expect(controller.current_request).to be_nil | ||
end | ||
|
||
it 'matches email case insensitively' do | ||
session[:email_address] = '[email protected]' | ||
|
||
expect(controller.current_request).to eq(request_instance) | ||
end | ||
end | ||
|
||
describe '#current_archived_intake' do | ||
|
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
describe "POST #update" do | ||
let(:valid_email_address) { "[email protected]" } | ||
let(:mixed_case_email_address) { "[email protected]" } | ||
let(:invalid_email_address) { "" } | ||
let(:ip_address) { "127.0.0.1" } | ||
|
||
|
@@ -44,6 +45,23 @@ | |
state_file_archived_intakes_edit_verification_code_path | ||
) | ||
end | ||
|
||
it "matches email case insensitively" do | ||
post :update, params: { | ||
state_file_archived_intakes_email_address_form: { email_address: mixed_case_email_address } | ||
} | ||
|
||
expect(assigns(:form)).to be_valid | ||
|
||
request = StateFileArchivedIntakeRequest.last | ||
expect(request.ip_address).to eq(ip_address) | ||
expect(request.email_address.downcase).to eq(valid_email_address) | ||
expect(request.state_file_archived_intake_id).to eq(archived_intake.id) | ||
|
||
expect(response).to redirect_to( | ||
state_file_archived_intakes_edit_verification_code_path | ||
) | ||
end | ||
end | ||
|
||
context "and a archived does not exist with the email address" do | ||
|