[rspec-users] id getting overwritten with 0 when testing

Julian Leviston julian at leviston.net
Wed Jan 25 02:27:11 EST 2012

It'd be nice to have a bit of context for this issue.

It's most likely an issue with your model's validation... 


On 25/01/2012, at 5:24 PM, Guyren G Howe wrote:

> My code that saves a record works fine in development or production, or from the console. I can take the code in my test and run it in the console, and it works fine.
> But when I run it under a model rspec, the ids are getting set to 0. I’ve traced it through to where I do:
> <Model>.create <params>
> where I can see that the id is what I want to set it to in params.
> Same problem with rspec 2.6 and 2.8.
> Don’t make me switch to Test::Unit. Anyone?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list