Test Tidbits

by Geoffrey Grosenbach

In preparation for two Ruby on Rails workshops in Sydney, Australia in a few weeks, I've discovered a few testing tidbits.

1 Comments

John Nunemaker
2006-12-21 10:44:43
One note on the 'Faster ActiveRecord callback tests': this only works if you have:


class Thing < ActiveRecord::Base
def before_create
#do something
end
end


...defined in your model. If you use:


class Thing < ActiveRecord::Base
before_create :some_method

private
def some_method
# do something
end
end


...it doesn't seem to actually call all the before_create methods. Anyone know anyway around this?