Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capybara 2.0.0.beta4 has undefined paths

I just upgraded to Capybara 2.0.0.beta4 with rspec-rails 2.11.4 and I moved my request spec (I only have one) to spec/features as advised by the Capybara-Readme in the RSpec-Rails repository. When I run the tests now it does not find any paths. So for the following test block:

it "should be able to access the signup page through the front page" do
  visit root_path
  click_link "Signup For Free Now"
  page.should have_content("Signup")
end

I get the error message:

Failure/Error: visit root_path
NameError: undefined local variable or method `root_path' for #<RSpec...>

When I try to run the test with visit "/" it works fine. Other gem versions are:

  • rails 3.2.1
  • rspec 2.11.0
  • rack-test 0.6.2

Any ideas for a reason for the path problem?

like image 760
TKAB Avatar asked Nov 12 '12 08:11

TKAB


1 Answers

Running "bundle update rspec-rails" to get version 2.12.0 solved the same issue for me.

like image 139
Nils Ivanson Avatar answered Sep 28 '22 07:09

Nils Ivanson