[rspec-users] expect_render

David Chelimsky dchelimsky at gmail.com
Mon Sep 29 15:54:39 EDT 2008


On Mon, Sep 29, 2008 at 2:52 PM, Scott Taylor
<mailing_lists at railsnewbie.com> wrote:
>
> I'm trying to write a spec asserting that no layout should be used in a
> controller.  My spec currently looks like this:
>
>    it "should render with no layout" do
>      controller.expect_render.with(hash_including(:layout => nil))

pre 1.1.5 this should be:

  controller.expect_render(hash_including(:layout => nil))
  (no with)

1.1.5 deprecates expect_render, having fixed the problem w/ should_receive:

  controller.should_receive(:render).with(hash_including(:layout => nil))

Cheers,
David


>      do_action
>    end
>
>
> And this code, which should pass the spec, isn't:
>
> class AController < ApplicationController
>  layout nil
> end
>
> What am I doing wrong?
>
> Best,
>
> Scott Taylor
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list