I\'m following the Ruby on Rails Tutorial by Michael Hartl (railstutorial.org).
At some point I got tired of tests failing just bescause the tests used old cached v
When you make a Capybara call, it uses rack-test to emulate a call to the rails app. Every time a call is completed, it reloads all rails classes. What this means is that the @user object you created before you called 'visit signin_path' gets nil'd out because all ActiveRecord objects have been reloaded.
When you set cache-classes to true, it tells Rack not to reload the ActiveRecord objects on every request, so your tests pass again.
I believe that if you want the test you wrote above to pass without turning on cache-classes, you should move the '@user = Factory(:user)' line below the 'visit signin_path' line.