我从 Webrat 迁移到 Capybara,现在我遇到了很多错误。例如在 webrat 我可以在集成测试中使用它:
response.should be_success
但水豚表明:
Failure/Error: response.should be_success
NoMethodError:
undefined method `success?' for nil:NilClass
有没有提供这种功能的方法?
UPD:我的规格:
require 'spec_helper'
describe "Admins" do
before(:each) do
@admin = FactoryGirl.create(:admin)
visit '/'
click_link "Login"
fill_in "Email", :with => @admin.email
fill_in "Password", :with => 'qwerty'
click_button "Sign in"
end
describe "Admin panel" do
it "should have correct links" do
click_link "User"
response.should be_success
end
end
end