So my first question on Stackoverflow..... =]
My tests in Chapter 5.3.2 of Michael Hartl\'s RoR Tutorial are all failing, when the tutorial says it should be passing
root :to => 'static_pages#home'
match '/help', to: 'static_pages#help', via: 'get'
match '/about', to: 'static_pages#about', via: 'get'
match '/contact', to: 'static_pages#contact', via: 'get'
works for me
test results: 9 examples 0 failures
urls seem to have changed like this now:
http://localhost:3000/about
Mischa's answer will hopefully fix most of those problems, but your tests may still fail on the root_path issue.
Have you removed index.html like so: git rm public/index.html
And don't forget to commit your changes with: git commit -am "Message"
I am using the same tutorial and ran into the exact same problem! You might've thought it was spork that fixed this but that wasn't it. The reason it worked is because you went ahead and upgraded the Rspec in the next section. It only works with the upgraded rspec - the old rspec was why your tests didn't pass. The site is wrong in that it tells users that the tests will pass before also changing the Rspec
I have same problem in this chapter, just change in config/routes.rb root to: 'static_pages#home' to root :to => 'static_pages#home' and it's start work. you can also check all routes with rake routes.
I had a similar issue. My fix was to include the following line in spec_helper.rb
config.infer_spec_type_from_file_location!
BTW gems are:
gem 'rails', '4.1.5'
gem 'rspec-rails', '~> 3.0'
and I also removed all the Guard and Spork stuff.
I'll put this as an answer because the solution (from @mischa) is buried in the comments under @marflar's answer: try restarting Spork to solve this issue.