# Before\_Save Filters Acting Goofy in Unit Test

**URL:** <https://www.ruby-forum.com/t/before-save-filters-acting-goofy-in-unit-test/113784>\
**Category:** Rails\
**Created:** [September 4, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/before-save-filters-acting-goofy-in-unit-test/113784 "2007-09-04T22:54:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyrubyruby\_onrail](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rubyrubyruby\_onrail](https://www.ruby-forum.com/u/rubyrubyruby_onrail)\
**Post date:** [September 4, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/before-save-filters-acting-goofy-in-unit-test/113784/1 "2007-09-04T22:54:35Z")

</div>

I have a fixture-less unit test that is not acting as expected.

My user model has 4 before\_save filters to create some associations,  
to deal with the format of the data that comes in.

In my test I am creating 5 users - my before\_save filters run on the  
first User, but not on any other. I’ve moved the order around, tried  
using puts in several places to follow the progress, but I can’t  
figure out what’s happening.

The Before\_Save filters and the Unit test are pastied at  
[http://pastie.caboo.se/private/qp58cvjkcl3efvij3i](http://pastie.caboo.se/private/qp58cvjkcl3efvij3i)

Any suggestions or insights would be appreciated. Thanks a lot.
