[rspec-users] rails rspec silently failing

Will Schenk wschenk at gmail.com
Tue Feb 5 16:58:47 EST 2008

I've been beating my head against this for a couple of hours now, and  
I'm a bit frustrated, so I apologize in advance.

I'm trying to use rspec to test an order processing system, which uses  
google checkout.  The idea was to have a couple of orders in the  
database in various stages, and hit the notifier interface to make  
sure that everything transitioned to the right place.  However, I  
can't get to this, because rspec seems to silently blow-up somewhere.   
This code "passes":

require File.dirname(__FILE__) + '/../spec_helper'

describe OrdersController do
   fixtures :orders

   it "should set the right order amount" do

     post "subscribe", {:sub_type => "1"}

     fail "This should throw an error"

It then returns: "0 examples, 0 failures".

How is such a thing possible?  This seems like a serious problem; I  
would expect an exception from somewhere inside of the post, or the  
fail message.  Instead everything is green.

My only hypothesis is that since I'm creating an order object and  
calling a bunch of methods on it and somehow that's verbotten.  The  
docs mention suggests mocking domain objects -- which seems if not  
completely misguided at least seriously counter-intuitive -- and  
perhaps this has something to do with it.  But silently imploding  
seems more like a bug.

I should mention that the controller actually works in Real Life, but  
I was trying to get a little piece of mind and work out all the  
permutations in a test just to make sure.  And failing silently is  
worse than no testing at all.

Taking a few deep breaths,

More information about the rspec-users mailing list