जब मैं अपने सुविधाओं को चलाने मैं इस त्रुटि मिलती है:ककड़ी step_definitions में अपरिभाषित 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
# […]
कुछ भी मैं याद आ रही है यहाँ?
# […]
require 'webrat'
require 'webrat/core/matchers'
Webrat.configure do |config|
config.mode = :rack
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end
# […]
अब अपेक्षा के अनुरूप काम करता है:
वाह ... क्योंकि मुझे अभी इस के लिए एक लोकप्रिय प्रश्न बैज मिला है, ऐसा लगता है कि यह अभी तक पैच नहीं किया गया है। बाद में इसे जांच लेंगे ... –