This feature worked a bit, then stopped working.
Background:
Given a user is logged in
Then I should see "Signed in successfully."
With
Given /^a user is logged in$/ do
@user = FactoryGirl.create(:user)
@user.confirm!
visit new_user_session_path
fill_in 'Email', :with => @user.email
fill_in 'Password', :with => @user.password
click_on 'Sign in'
end
Then /^I should see "(.*?)"$/ do |message|
page.should have_content(message)
end
Given a user is logged in passes but Then I should see "Signed in successfully." fails with the error expected there to be content "Signed in successfully.". It stays in the sign in page.
Anyone has an idea what might be the problem?
Solved!
I changed
to
It’s weird that Capybara did not complain about not finding a
Sign into click on.Thanks everyone for your comments and answers!