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

2012-01-25 Thread Justin Ko
On Jan 25, 2012, at 12:43 AM, Guyren G Howe wrote: On Jan 24, 2012, at 11:27 PM, Julian Leviston wrote: 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

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

2012-01-25 Thread Julian Leviston
It'd be nice to have a bit of context for this issue. It's most likely an issue with your model's validation... Julian 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

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

2012-01-25 Thread Patrick J. Collins
On Wed, 25 Jan 2012, Justin Ko wrote: http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord-primary-key Make sure the column is 16-byte binary And be sure to update your test database's schema so that it behaves the same as your other environments: rake

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

2012-01-25 Thread Justin Ko
On Jan 25, 2012, at 1:42 AM, Patrick J. Collins wrote: On Wed, 25 Jan 2012, Justin Ko wrote: http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord-primary-key Make sure the column is 16-byte binary And be sure to update your test database's schema so that it behaves

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

2012-01-25 Thread Julian Leviston
See that's HEAPS better! More information. Pffft ... not sure what else to tell us! Okay so NOW to me it sounds a lot like you're using a non-integer as a primary key which I wouldn't do... And also, could it not be a string coersion issue? (ie params coersion) Julian On 25/01/2012, at 6:43

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

2012-01-25 Thread David Chelimsky
On Wed, Jan 25, 2012 at 3:29 PM, Guyren G Howe gisbo...@emailuser.net wrote: On Jan 25, 2012, at 3:44 AM, Julian Leviston wrote: Okay so NOW to me it sounds a lot like you're using a non-integer as a primary key which I wouldn't do... I don’t think you’ve tried to write a server app that

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

2012-01-25 Thread Guyren G Howe
On Jan 25, 2012, at 1:45 PM, David Chelimsky wrote: Just looked back at your initial email and see you cited rspec-2.8, but the way Rails handles incoming params in tests changed in either 3.1 or 3.2 (I have to check). Which rails version specifically? 3.1. Since I was *always* going to be

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

2012-01-25 Thread David Chelimsky
On Wed, Jan 25, 2012 at 3:37 PM, David Chelimsky dchelim...@gmail.com wrote: On Wed, Jan 25, 2012 at 3:29 PM, Guyren G Howe gisbo...@emailuser.net wrote: On Jan 25, 2012, at 3:44 AM, Julian Leviston wrote: Okay so NOW to me it sounds a lot like you're using a non-integer as a primary key

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

2012-01-25 Thread David Chelimsky
On Wed, Jan 25, 2012 at 3:49 PM, Guyren G Howe gisbo...@emailuser.net wrote: On Jan 25, 2012, at 1:45 PM, David Chelimsky wrote: Just looked back at your initial email and see you cited rspec-2.8, but the way Rails handles incoming params in tests changed in either 3.1 or 3.2 (I have to

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

2012-01-25 Thread Guyren G Howe
On Jan 25, 2012, at 1:56 PM, David Chelimsky wrote: I'd start by debugging to see where the wheels fall off. Are you familiar/comfortable with Ruby's debugger? Sure. What’s happening is that during the save process, I get to field_changed? in dirty.rb, which does value =

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

2012-01-25 Thread Guyren Howe
On Jan 25, 2012, at 4:50 PM, Guyren G Howe wrote: On Jan 25, 2012, at 1:56 PM, David Chelimsky wrote: I'd start by debugging to see where the wheels fall off. Are you familiar/comfortable with Ruby's debugger? Sure. What’s happening is that during the save process, I get to

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

2012-01-25 Thread David Chelimsky
On Wed, Jan 25, 2012 at 7:20 PM, Guyren Howe guy...@mac.com wrote: On Jan 25, 2012, at 4:50 PM, Guyren G Howe wrote: On Jan 25, 2012, at 1:56 PM, David Chelimsky wrote: I'd start by debugging to see where the wheels fall off. Are you familiar/comfortable with Ruby's debugger? Sure.

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

2012-01-25 Thread Justin Ko
On Jan 25, 2012, at 6:20 PM, Guyren Howe wrote: On Jan 25, 2012, at 4:50 PM, Guyren G Howe wrote: On Jan 25, 2012, at 1:56 PM, David Chelimsky wrote: I'd start by debugging to see where the wheels fall off. Are you familiar/comfortable with Ruby's debugger? Sure. What’s happening

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

2012-01-24 Thread Guyren G Howe
On Jan 24, 2012, at 11:27 PM, Julian Leviston wrote: 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