Note that there are some explanatory texts on larger screens.

plurals
  1. POCapybara Acceptance Tests: undefined method `visit' for #<RSpec::Core::ExampleGroup
    primarykey
    data
    text
    <p>I'm in the process of upgrading an old krufty application to Rails 3.1. The company has been using RSpec and Capybara for acceptance tests. We've got some acceptance tests under <code>spec/acceptance</code> that are failing with the following message:</p> <pre><code>Failure/Error: get @url NoMethodError: undefined method `get' for #&lt;RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007feb7c0abf58&gt; </code></pre> <p>Here's an example of one of the tests (from the top of the file):</p> <pre><code>require_relative 'acceptance_helper' feature 'Catalog' do before do Settings.use_catalog_navigation = true end context 'with a Vendor' do before do @vendor = create(:vendor, slug: 'abc') @product = create(:product_with_variants, vendor: @vendor) @non_vendor_product = create(:product_with_variants) @invisible_product = create(:product_with_variants, vendor: @vendor, visible: false) @non_available_product = create(:product_with_variants, vendor: @vendor, available: false) @url = "/#{@vendor.slug}" end it 'sets @vendor' do # &lt;- FIRST FAILING TEST get @url assigns(:vendor).should == @vendor end ... </code></pre> <p>When consulting the oracle, I keep stumbling across issues mentioning the 'visit' method such as this: <a href="https://github.com/jnicklas/capybara/issues/814" rel="nofollow">https://github.com/jnicklas/capybara/issues/814</a></p> <p>I also keep coming across posts related to this article: <a href="http://alindeman.github.com/2012/11/11/rspec-rails-and-capybara-2.0-what-you-need-to-know.html" rel="nofollow">http://alindeman.github.com/2012/11/11/rspec-rails-and-capybara-2.0-what-you-need-to-know.html</a></p> <p>I'm not sure that I'm having the same issue. I can post my <code>spec_helper.rb</code> and <code>acceptance_helper.rb</code> if they will be of any use.</p> <p>I guess it's worth noting that these specs passed before I updated rspec-rails and capybara.</p> <p>My gut feeling is that perhaps rspec-rails is clobbering some of capybara's methods, or some of capybara's methods are simply no longer being loaded. Could that be the issue?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload