Rails 3 rspec + capybara - current_path nil?

I have it in my users_spec.rb

scenario "Go to contact page" do visit "/contact" current_path.should == contact_path end 

After running rspec, I get

 Failure/Error: current_path.should == contact_path expected: "/contact" got: nil (using ==) 

For some reason, current_path seems to return nil. Is there some kind of configuration that I am missing?

+6
source share
1 answer

Authors answer:

Min ming lo

It turns out that since webrat is also included, there was some kind of conflict. I commented on my webrat from my gem file (which I wasn’t using anyway). It was included earlier for some other trials (and also because of many outdated study guides).

+1
source

Source: https://habr.com/ru/post/903083/


All Articles