Add a test which checks for Case Mapping Collisions when resetting pw

See here for more information
https://eng.getwisdom.io/hacking-github-with-unicode-dotless-i/
This commit is contained in:
Luke Rollans
2019-12-17 13:40:41 +08:00
parent 43068ac239
commit 9fb079c097

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: 'luke@github.com')
request_forgot_password do
fill_in 'email', with: 'luke@gıthub.com'
end
mail = ActionMailer::Base.deliveries.last
assert_equal ['luke@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')