> I haven't used ActiveRecord in quite awhile (been using MongoDB), but it
> looks like you cannot instantiate a record with attributes that don't exist.
> I think you have two options here:
>
> 1.) Only use valid attributes in your params.
> 2.) Add `with` to your stub to exactly match the arguments to `.new`:
> Post.stubs(:new).with({last_post_params: {foo:
> 'bar'}}).returns(fake_post)
Yeah.. I originally had tried your 2nd option... Putting an expectation on
the arguments sent to new made no difference. I just tried it again to verify,
and I still get the same error. Seems so weird to me.
Patrick J. Collins
http://collinatorstudios.com
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users