[rspec-devel] Should controller specs fail if you don't make a request?

Edvard Majakari edvard at majakari.net
Fri Apr 11 01:43:59 EDT 2008

On Thu, Apr 10, 2008 at 6:44 AM, Pat Maddox <pergesu at gmail.com> wrote:

> A friend of mine just IMed me asking why his spec didn't pass.  It looked like
>  describe FooController, "POST create" do
>   it "should build a new Foo" do
>     Foo.should_receive(:new).and_return @mock_foo
>   end
>  end

I've had the same problem a few times, though I think I found out the
reason quickly enough. Still, I think it's a good idea. But to be
certain, maybe there should be an option for ignoring the missing
request from a spec. Otherwise,
maybe a warning should be emitted.

"One day, when he was naughty, Mr Bunnsy looked over the hedge into
Farmer Fred's field and it was full of fresh green lettuces. Mr
Bunnsy, however, was not full of lettuces. This did not seem fair."
 -- Terry Pratchett, Mr. Bunnsy Has An Adventure

More information about the rspec-devel mailing list