Skip to content

Commit

Permalink
Revise sign-in, sign up specs for case-insensitivity
Browse files Browse the repository at this point in the history
Devise began humanizing the authentication_keys variable referenced in its default locale file in version 4.1.0.  Setting specs to look for case-insensitive error messages that would contain "Email" based on authentication_key.
  • Loading branch information
christinalcole committed Aug 24, 2017
1 parent 81a16dc commit 88fa9a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/features/users/signin_and_signup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.feature 'Sign in', :devise do
scenario 'a user cannot sign in if not registered' do
signin('test@example.com', 'please123')
expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
expect(page).to have_content (/#{I18n.t('devise.failure.not_found_in_database', authentication_keys: 'email')}/i)
end

scenario 'a user can sign in with valid credentials' do
Expand All @@ -15,13 +15,13 @@
scenario 'a user cannot sign in with a wrong email' do
user = FactoryGirl.create(:user)
signin('invalid@email.com', user.password)
expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
expect(page).to have_content (/#{I18n.t('devise.failure.not_found_in_database', authentication_keys: 'email')}/i)
end

scenario 'a user cannot sign in with wrong password' do
user = FactoryGirl.create(:user)
signin(user.email, 'invalidpass')
expect(page).to have_content I18n.t 'devise.failure.invalid', authentication_keys: 'email'
expect(page).to have_content (/#{I18n.t('devise.failure.not_found_in_database', authentication_keys: 'email')}/i)
end
end

Expand Down

0 comments on commit 88fa9a2

Please sign in to comment.