1

此功能工作了一点,然后停止工作。

Background:
  Given a user is logged in
  Then I should see "Signed in successfully."

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通过但因Then I should see "Signed in successfully."错误而失败expected there to be content "Signed in successfully."它停留在登录页面中

任何人都知道可能是什么问题?

4

2 回答 2

1

解决了!

我变了

click_on 'Sign in'

click_button 'Sign in'

奇怪的是,Capybara 没有抱怨找不到Sign in可点击的。

感谢大家的评论和回答!

于 2012-06-12T13:16:59.520 回答
0

尝试将launchy添加到您的测试 gemspec 组并save_and_open_page在单击“登录”后调用 - 这应该可以帮助您查看您的登录过程是否有任何问题。

于 2012-06-12T12:11:21.143 回答