[rspec-users] Weird failing spec

Tarsoly András tarsolya at gmail.com
Fri Oct 26 19:27:54 EDT 2007

On 2007.10.26., at 21:28, Ashley Moran wrote:

> First, like David said earlier, you're putting too much into one spec:
> Also I don't think you need '@option = ' in front of
> @option.update_attributes!, as that method call modifies the object
> in-place.  But that's a Rails issue.
> One other thing - you aren't stubbing CalcumOption.find in
> 'Admin::OptionsController, "#update (POST) with valid params"'.  Are
> you sure this isn't loading real models?

Yes, I was aware of this as I was just messing around, trying to  
figure out where could this failed specs could come from, I pastied  
the real stuff with a rake spec --trace output here:


> As for the actual problem you asked about... sorry but I am lost.
> I've looked over it about 5 times and everything I thought was wrong
> was me not paying attention.  I can't see ANY reason it should fail.
> Is it still not working?

In the link above, you can see, that the specs still fail. Looks like  
it has to do something with exception handling as only those examples  
fail which should raise errors (eg. doing :create!  
or :update_attributes! with invalid and/or missing attributes and  
specing :and_raise())

The test.log sample in the pastie shows unfinished requests in all  
the :update! specs, where the :update_attributes! is stubbed on the  

However, one example at #create raises an Exception properly, which  
can be seen in the log too, only where I'm using :and_raise().

I believe I stubbed everything out properly in the above example. I'm  
using edge rspec with the latest rspec_on_rails and using autotest  
for convenient coding.

The problem is, I'm rather new to rspec / ruby / rails, so I can't  
just start to track this down, however I went into the rspec source  
already, but got lost pretty much :)


Tarsoly András
tarsolya at gmail.com

More information about the rspec-users mailing list