- ActiveRecord Calls (using mocking)
- Assigns
- Flash
- Responses
And if the response content type is not going to be HTML I will test that as well.
And if the response content type is not going to be HTML I will test that as well.
I've been stung by this a couple of times so it's time to add it to my blog. This exception is raised when Cucumber follows a link using the click_link Capybara method. An example of the error:
When I follow "Add brand" # features/step_definitions/web_steps.rb:33
undefined local variable or method `node' for # (NameError)
./features/step_definitions/web_steps.rb:35:in `block (2 levels) in '
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:34:in `/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/'
features/manage_brand.feature:14:in `When I follow "Add brand"'
This has been report in the following places:
The solution is to either remove the following line from env.rb:
require 'cucumber/capybara-javascript-emulation'
or better yet, simply bundle the Gem from the 'master' branch. Add this to your Gemfile:
group :development, :test do gem 'cucumber-rails', :git => 'git://github.com/aslakhellesoy/cucumber-rails.git' # other gems... end
Important Note: You must regenerate your env.rb using rails g cucumber:install otherwise you will receive the following error:
no such file to load -- cucumber/rails/active_record (LoadError)
This blog is no longer being maintained. The blog once was a part of my Ruby on Rails freelancing practice. If you would like to find out what I'm currently working on, please visit CivilCode Inc - Custom Software Development; we specialize in building tailored business application in Elixir and Phoenix.
2002-2019 Nicholas Henry
All Rights Reserved
Please note this blog is no longer maintained. Please visit CivilCode Inc - Custom Software Development.