当我运行我的功能时,我收到此错误:
undefined method `visit' for #<Cucumber::Rails::World:0x81b17ac0> (NoMethodError)
这是我的相关部分Gemfile
。
group :development, :test do
gem "rspec-rails", ">= 2.0.0.beta.19"
gem "cucumber"
gem "cucumber-rails", ">= 0.3.2"
gem 'webrat', ">= 0.7.2.beta.1"
end
相关的 step_definition (虽然我认为这并不重要)
When /^I create a movie Caddyshack in the Comendy genre$/ do
visit movies_path
click_link "Add Movie"
fill_in "Title", :with => "Caddyshack"
check "Comedy"
click_button "Save"
end
在 env.rb 我有以下 Webrat 配置:
# […]
require 'webrat'
require 'webrat/core/matchers'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end
# […]
我在这里缺少什么吗?