Missing fixtures declarations cause test failures
November 14th, 2006
Bob Silva posted Testing Gotchas in Rails in mid-October. I had fallen across this error myself a few times.
Well, today I had a huge code base I needed to check. I wrote the following Rake task:
Run it like this:Why do I report both the file and TestCase name ? Because I put more than one TestCase per test file, as I reported in Test fixtures and behavioral testing
Of course, if I could do away with fixtures altogether…
October 12th, 2007 at 10:25 PM
“Of course, if I could do away with fixtures altogether…”
Why don’t you? There is absolutely no need for Rails fixtures. Doing away with fixtures will make your tests less brittle, faster and clearer. Well worth it!
October 12th, 2007 at 10:25 PM
Because the alternatives aren’t faster, better. We still need to do some tests using the full stack. I know about Mocha, but it’s not perfect for all situations.
Good dream, should come one day. I simply hope it’s sooner rather than later.