2
 visit new_admin_user_session_path
 fill_in('admin_user_email', :with =>  "admin@example.com")
 fill_in('admin_user_password', :with => "password")
 click_button('Login')
 page.must_have_content("Signed in successfully")

After running my test i am getting error like :

MiniTest::Assertion: expected there to be text "Signed in successfully" in "Invalid email or password. Shakti Login Email*Password*Remember me Forgot your password?".
.rvm/gems/ruby-1.9.3-p362/gems/capybara_minitest_spec-1.0.0/lib/capybara_minitest_spec.rb:42:in `block in define_assertion'
(eval):6:in `must_have_content'
4

1 回答 1

1

用户很可能不在数据库中。首先创建它: admin = FactoryGirl.create(:admin_user, email: 'admin@example.com', password: 'password')如果您使用的是 FactoryGirl

于 2013-04-28T08:18:14.510 回答