search for: find_last_created

Displaying 1 result from an estimated 1 matches for "find_last_created".

2007 Sep 26
0
Testing record creation independently of implementation
...parameters. So, @model.should_receive(:create).with(params) or, @model.should_receive(:new).with(params) But if I wanted to have it be implementation independent, then the only thing I can think of is to check the database at the end for the record I''m expecting, like, @model = Model.find_last_created @model.attributes.should be == params There are some assumptions here, but at least it is focussed on the end result of the record, and not so much how it was created. Any suggestions are really appreciated. Thanks in advance! Keith