Either a) the snippet in the book is not meant to be the entire file, or b) it only works in my code because I run the entire suite, so the rails helper file is already loaded. (This is off the top of my head, I’m not looking at the book right now.)
Running the individual test in isolation in the author’s working project results in success:
However, performing the same operation in my project fails:
<top (required)>': undefined method feature’ for main:Object (NoMethodError)
What configuration is missing from my project?
Oh, I bet it’s the .rspec file.
Mine looks like this:
--color --require spec_helper --require rails_helper
The last two lines trigger a require for each file even if it’s not listed in the file.
Status: Solved. Thank you, Noel.