title: Rspec error for failing test different than the error seen in browser
body: <p>Im using RSpec v3.1.0 and Capybara v2.3.0 in my rails app.I have the following in my <strong>spec/features/user_creates_todo_spec.rb</strong>.</p>
  
  <pre><code>require 'rails_helper'
  
  feature 'User creates todo' do 
      scenario 'successfully' do
          visit root_path
  
          click_on 'Add a new todo'
          fill_in 'Title', with: 'Buy milk'
          click_on 'Submit'
  
          expect(page).to have_css '.todos li', text: 'Buy milk'
      end
  end
  </code></pre>
  
  <p>Then in my <strong>app/views/todos/index.html.erb</strong>, i added the following:</p>
  
  <pre><code>&lt;%= link_to "Add a new todo", new_todo_path %&gt;
  </code></pre>
  
  <p>When i run <strong>rspec spec/features/user_creates_todo_spec.rb</strong>,the test fails with an error <strong>Capybara::ElementNotFound: Unable to find link or button "Add a new todo"</strong></p>
  
  <p>However, im expecting the error to be: <strong>Undefined local variable or method 'new_todo_path'</strong>, since i already have the link defined in my view . And the strange thing is that when i run the rails server and navigate to the root path from the browser i see the undefined local variable or method 'new_todo_path' error.Also, i see the undefined path error when i just run rake from the root of my app. So, why is it that when i run the spec file individually using rspec i see a different error even though i have the link added to the page ?</p>
  
  <p>Thanks</p>