From 9fb079c09739b903ad48bade995c7c85d88d72f0 Mon Sep 17 00:00:00 2001 From: Luke Rollans Date: Tue, 17 Dec 2019 13:40:41 +0800 Subject: [PATCH] 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/ --- test/integration/recoverable_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/integration/recoverable_test.rb b/test/integration/recoverable_test.rb index c834f1d2..fde78059 100644 --- a/test/integration/recoverable_test.rb +++ b/test/integration/recoverable_test.rb @@ -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')