I have this 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 seem to be returning nil. Is there a configuration that I am missing?
Authors answer:
Min Ming Lo
It turns out that because webrat is also included, there was some sort of conflict. I commented out my webrat from my gem file (which I wasn't using anyway). It was included earlier for some other testing (and also due to many outdated tutorials out there).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With