I’ve completed Chapter 5 and all the exercises. As part of the final exercise, MH has you write tests for the ApplicationHelper method.
Once that is done, individual tests pass with:
shift-command-Tin ST2 (using the sublime-text-2-ruby-tests package)rspec spec/requests/user_pages_spec.rbin the terminalrspec spec/requests/static_pages_spec.rbin the terminal
However, if I run all tests with rspec spec/ in the terminal I get this error:
/Users/anonymouscoward/rails/railstut/sample_app/spec/helpers/
application_helper_spec.rb:1:in `<top (required)>': uninitialized
constant ApplicationHelper (NameError)
If I run spork and try rspec spec/ again, all tests pass.
I’m not sure I understand why this works the way it does, or whether I’ll always need to have spork running in the future when I want to run all my tests. Thanks.
I’m not sure, but maybe you forgot to require spec_helper.
If so, just insert this in the first line of application_helper_spec.rb