Merge pull request #5172 from lukerollans/chore/case-mapping-collisions-test

Add a test which checks for Case Mapping Collisions when requesting a password reset
This commit is contained in:
Rafael França
2020-01-22 12:23:22 -05:00
committed by GitHub

View File

@@ -33,6 +33,17 @@ class PasswordTest < Devise::IntegrationTest
click_button 'Change my password'
end
test 'reset password should send to user record email and avoid case mapping collisions' do
create_user(email: 'user@github.com')
request_forgot_password do
fill_in 'email', with: 'user@gıthub.com'
end
mail = ActionMailer::Base.deliveries.last
assert_equal ['user@github.com'], mail.to
end
test 'reset password with email of different case should succeed when email is in the list of case insensitive keys' do
create_user(email: 'Foo@Bar.com')