Test setup broken in Rails 2.0.2
Some changes went into rails 2.0.2 that mean the setup method in test subclasses won’t get called. Here’s how it went down:
You can see some code illustrating the problem in 8445. This affects two plugins that we’re using – helper_test and activemessaging.
For the helper test, the work around is to rename your helper test setup methods to setup_with_fixtures.
1 2 3 |
def setup_with_fixtures super end |
For activemessaging, add the following line to the setup of your functionals that are failing (from the mailing list):
1 |
ActiveMessaging.reload_activemessaging
|
December 21, 2007 at 3:23 AM
Awesome mate, had this exact issue yesterday upgrading another app to Rails 2.0.2 and seeing many test failures – I’d expect a 2.0.3 to be out pretty soon then :)
February 08, 2008 at 4:01 AM
thank you so much
February 22, 2008 at 6:46 AM
That was a really nasty regression for a double point release. Spent a couple hours trying to figure out what went wrong because I had just done a 10,000 line merge.
April 25, 2008 at 2:42 AM
Thank you so much for mentioning this bug. It saved me a lot of trouble. I was suspecting some problem with my fixtures when I found your post. That stupid setup method actually was never called. Hope they fix it soon :o).
Matthias
June 12, 2008 at 9:57 PM
Dude! Couldn't figure this out last night, couldn't figure it out this morning... tried a different search term and boom, came across your comment on another site. You are glorious. Glory glory!