Use case insensitive test for devise sessions
This commit is contained in:
parent
b84a833d10
commit
4bf08ca446
@ -9,7 +9,7 @@ feature 'Sign in', :devise do
|
||||
# Then I see an invalid credentials message
|
||||
scenario 'user cannot sign in if not registered' do
|
||||
signin('test@example.com', '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: User can sign in with valid credentials
|
||||
@ -20,7 +20,7 @@ feature 'Sign in', :devise do
|
||||
scenario 'user can sign in with valid credentials' do
|
||||
user = FactoryGirl.create(:user)
|
||||
signin(user.email, user.password)
|
||||
expect(page).to have_content I18n.t 'devise.sessions.signed_in'
|
||||
expect(page).to have_content(/#{I18n.t 'devise.sessions.signed_in'}/i)
|
||||
end
|
||||
|
||||
# Scenario: User cannot sign in with wrong email
|
||||
@ -31,8 +31,7 @@ feature 'Sign in', :devise do
|
||||
scenario 'user cannot sign in with 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: User cannot sign in with wrong password
|
||||
@ -43,7 +42,6 @@ feature 'Sign in', :devise do
|
||||
scenario '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.invalid', authentication_keys: 'email'}/i)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user