您好,我在使用 railstutorial 时遇到问题。
我有测试文件features/static_pages_spec.rb
require 'spec_helper'
describe "Static pages" do
describe "Home page" do
it "Should have the content 'Sample App'" do
visit '/static_pages/home'
page.should have_conent('Sample App')
end
end
end
当我跑步时bundle exec rspec spec/features/static_pages_spec.rb
我收到以下错误:
Failures:
1) Static pages Home page Should have the content 'Sample App'
Failure/Error: page.should have_conent('Sample App')
NoMethodError:
undefined method `has_conent?' for #<Capybara::Session>
# ./spec/features/static_pages_spec.rb:9:in `block (3 levels) in <top (required)>'
Finished in 0.05262 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/features/static_pages_spec.rb:6 # Static pages Home page Should have the content 'Sample App'
Randomized with seed 49777
我试图添加,spec_helper.rb
config.include Capybara::DSL
但它给了我同样的错误。