[rspec-users] specifying a controller's layout

Dave Phiri lists at ruby-forum.com
Thu Oct 16 10:06:05 EDT 2008

Jim Gay wrote:
> On Oct 16, 2008, at 7:59 AM, Dave Phiri wrote:
>> David:
>> Why is it that
>> get :some_action
>> controller.expect_render(:layout => 'special_layout')
>> ie having the get statement before the controller.expect.. statement
>> produces the ff error:
>> Mock 'expect_render_mock_proxy' expected :render with
>> ({:layout=>"special_layout"}) once, but received it 0 times
> Because you are creating an expectation for the following action.
> In your code above, you are doing the action, and then creating an
> expectation for a following action which never occurs, so it receives
> it 0 times following that expectation.
> -Jim

Thanks Jim,
It all now makes sense to me. I am barely a wk old in rspec. A lot many 

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list