Neeraj Kumar
2006-Jun-24 14:36 UTC
[Rails] before_save and before_update not being called in tests
In one of the models I perform some operation. For simplicity let''s
assume
that I populate column ''b'' with column ''a'' *
2.
def before_update
self.b = self.a * 2
end
In my fixture I set values for a.
first:
id: 1
a: 10
Whe I run the test before_update is never invoked when rails populate the
test table with the data from fixture. In development mode from the browser
everything works fine.
Any idea why in test the berfore_* methods are not being invoked.
-=-
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060624/e8fbdd89/attachment.html
