small medium large xlarge

Back to: All Forums  Take My Money
07 Apr 2017, 20:52
James O'Neill (3 posts)


I’m trying to follow along with the project in the book and have hit a bit of a stumbling block. I tried to run the first set of tests and got an undefined method error for login_as.

Initially I thought I’d missed something and checked the downloaded project files for anything obvious that might point to what I did wrong. After having no luck I decided to try running this test in the downloaded project and got the exact same error.

While it wouldn’t surprise me if I have missed something (while I have some knowledge of Rails I don’t use it day to day), I’m wondering if there’s an issue with a gem version or something.

07 Apr 2017, 20:55
Noel Rappin (47 posts)

Hi James, sorry to hear you are having trouble. Which branch are you getting the error in (the first part of the code directory, something like cart/01, or something?

07 Apr 2017, 21:12
James O'Neill (3 posts)

Hi Noel, thanks for responding. Yes, it’s cart/01 that I’m getting the error with.

08 Apr 2017, 15:52
James O'Neill (3 posts)

It turns out I was missing something.

I hadn’t uncommented Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } in rails_helper.rb. Now that I have the test is running fine (well, moving to the next failure but that’s an expected failure). I’m pretty sure what I thought was the same error in the sample app was actually just me being tired and not realising the terminal directory was still my project.

You must be logged in to comment