small medium large xlarge

07 Nov 2010, 20:02
Steve Mills (4 posts)

I’m in the chapter “Iteration B2: Unit Testing of Models”. Although the application so far works fine, the test in this chapter fails “NoMethodError: undefined method `products’”.

It would appear that “products” here refers to the data being established through the fixtures. I cannot see how to get past this problem. I am running this on Windows 7 and have tried it both from within the RubyMine IDE and from the command line and the result is exactly the same.

Although this Forum is for the 3rd Edition of the book, I am in fact reading the 4th Edition for which I have subscribed to updates and have the latest update (not that this section changed during the last update).

Any help would be much appreciated.

I am very interested in the TDD but am forced to skip this part of the book and continue building the application.

P.S. I also found that I needed to set ‘self.use_transactional_fixtures = false’ otherwise the test loaded up the Products table and then promptly rolled it back before running the tests.

You must be logged in to comment