The sign in spec that was generated with the rails 4 template is failing, and it seems like what is being returned in the test environment should make the spec pass.
spec: Sign in user caot sign in if not registered Is looking for "Invalid Email or Password" on the page. When I try to login in with invalid credentials this message is definitely displayed in the flash messages. Also, you can see that the page content returned by capybara in the test env has the text 'Invalid Email or Password'. See below:
1) Sign in user caot sign in if not registered
Failure/Error: expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
expected to find text "Invalid email or password." in "Toggle navigation Home About Sign in Sign up × Invalid Email or password. Sign in Sign up Email Forgot password? Password Remember me"
# ./spec/features/users/sign_in_spec.rb:13:in `block (2 levels) in <top (required)>'
2) Sign in user caot sign in with wrong email
Failure/Error: expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
expected to find text "Invalid email or password." in "Toggle navigation Home About Sign in Sign up × Invalid Email or password. Sign in Sign up Email Forgot password? Password Remember me"
# ./spec/features/users/sign_in_spec.rb:35:in `block (2 levels) in <top (required)>'
3) Sign in user caot sign in with wrong password
Failure/Error: expect(page).to have_content I18n.t 'devise.failure.invalid', authentication_keys: 'email'
expected to find text "Invalid email or password." in "Toggle navigation Home About Sign in Sign up × Invalid Email or password. Sign in Sign up Email Forgot password? Password Remember me"
# ./spec/features/users/sign_in_spec.rb:46:in `block (2 levels) in <top (required)>'
What am I doing wrong?
