I’m having the same problem the OP mentions – undefined method
“visit”
Trying to upgrade from Rails 2.3 to Rails 3.0.beta4
My test stack:
webrat (0.7.1)
cucumber (0.8.3)
pickle (0.2.1)
factory_girl (1.3.0)
factory_girl_rails (1.0)
I changed config.mode = :rack, as suggested, but I"m still getting the
error.
This is what I have in features/support/env.rb:
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
This is the error I’m getting:
Given I am logged in as a
buyer # features/
step_definitions/user_steps.rb:15
undefined method visit' for #<Cucumber::Rails::World:0xd2f8a2> (NoMethodError) ./features/step_definitions/user_steps.rb:6:inlog_out’
./features/step_definitions/user_steps.rb:37:in do_login' ./features/step_definitions/user_steps.rb:17:in/^I\ am\ logged
\ in\ as\ a\ (.*)$/’
features/buyer_account.feature:7:in `Given I am logged in as a
buyer’
Apparently Webrat is not yet compatible with Rails 3:
line 2: require “action_controller/integration”
action_controller/integration.rb does exist in Rails 2 but not in Rails
3, but I didn’t find any branch for Rails 3 in webrat’s repository.
I’ll give Capybara another try. I had already tried it before but didn’t
change to it because I couldn’t get the Drag & Drop javascript test to
work anyway, but it seems to be a good replacement to Webrat’s and there
seems to be plans to merge them…
Does anyone here use Capybara with Rspec2 and Rails 3 without Cucumber
to write integration tests successfully?
factory_girl_rails (1.0)
config.mode = :rack
(NoMethodError)
./features/step_definitions/user_steps.rb:6:in log_out' ./features/step_definitions/user_steps.rb:37:in do_login’
./features/step_definitions/user_steps.rb:17:in /^I\ am\ logged \ in\ as\ a\ (.*)$/' features/buyer_account.feature:7:in Given I am logged in as a
buyer’
Up until now, this thread has been about an issue with RSpec. You are
having an issue with Cucumber. I’d recommend posting it to the Cucumber
google group: