Re: [rspec-users] Count error on lambda should change

2010-12-18 Thread Pat Maddox
Sounds like a validation failure. My guess is that you're re-using the factory-created record's attributes, and your example fails because of a uniqueness validation. This would explain the rollback if you're using the create! or save! method. Pat On Dec 13, 2010, at 3:08 PM, djangst wrote:

Re: [rspec-users] Count error on lambda should change

2010-12-14 Thread djangst
The problem was related to the use of the factory-generated instance, in this case a parent with one child instance similar to Hartl's user/ micropost example, but different in that I require at least one child instance to be present (in the has_many relationship). I'm doing this in conjunction wi

Re: [rspec-users] Count error on lambda should change

2010-12-13 Thread David Chelimsky
On Mon, Dec 13, 2010 at 4:31 PM, djangst wrote: > Hi, any idea what could cause the following error in a controller > test? > >     "count should have been changed by 1, but was changed by 0" > > I'm posting to a create route using a lambda, similar to Hartl's > example in his Rails tutorial: > >

[rspec-users] Count error on lambda should change

2010-12-13 Thread djangst
Hi, any idea what could cause the following error in a controller test? "count should have been changed by 1, but was changed by 0" I'm posting to a create route using a lambda, similar to Hartl's example in his Rails tutorial: it "should create a user" do lambda do post :create, :user =

[rspec-users] Count error on lambda should change

2010-12-13 Thread djangst
Hi, any idea what could cause the following error in a controller test? "count should have been changed by 1, but was changed by 0" I'm posting to a create route using a lambda, similar to Hartl's example in his Rails tutorial: it "should create a user" do lambda do post :create, :use