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

Guyren G Howe gisborne at emailuser.net
Wed Jan 25 01:24:59 EST 2012

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?

More information about the rspec-users mailing list