Scott Taylor wrote: > On Feb 11, 2009, at 8:51 AM, Kaleem Ullah wrote: > >> @user=User.new >> @user.active= '1' >> @user.reset_password_token= '' >> end > > You could benefit from a factory / data builder. See > FixtureReplacement, Fixjour, Factory girl, one of the many others out > there which would build this stuff *once* for you.
Kaleem, I recently installed nakajima-acts_as_fu (0.0.3) gem. This provides a rather painless way of specifying ActiveRecord model schemata on the fly in your specifications. You might find it helpful to look into this. You will discover that some people favour mocks and stubs when dealing with AR models in tests/specifications and some favour hitting the database. Once you decide on your own preference in this matter the choice of approach is somewhat simplified. -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users