運行我的功能,我得到這個錯誤:未定義webrat方法
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
# […]
什麼我很想念這裏?
哇...因爲我剛剛得到了這個問題的流行問題徽章,在我看來這還沒有修補。稍後會檢查出... – 2011-05-18 13:04:51