我收到有关“ ...”的错误消息
规格/功能/test_name_spec.rb
require "spec_helper"
describe "the signin process", :type => :feature do
it "does not sign me in if I use the wrong password" do
visit '/users/sign_in'
within("#new_user") do
user = Fabricate(:user, email: '[email protected]', password: 'password')
fill_in 'Email', :with => 'user@ example.com'
fill_in 'Password', :with => 'badone'
end
click_button 'Log in'
expect(response).to render_template(:new)
end
end
宝石文件
group :test do
gem 'shoulda-matchers', '~> 2.8', require: false # now loaded inside of spec/spec_helper.rb
gem 'capybara', '~>2.4'
gem 'launchy'
gem 'capybara-email', github: "dockyard/capybara-email"
gem 'database_cleaner', '~> 1.5', '>= 1.5.1'
end
我很困惑,因为上面的测试成功使用了期望,但是 page
expect(page).to have_content 'Signed in successfully.'
这可能是怎么回事?
编辑
我已将其更改为...
expect(page).to have_content 'Log in'
基本上是同一回事,但我仍然想知道为什么response
会出错。它是否在Capybara中不可用,或者还有另一个问题为什么不起作用?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句