views:

16

answers:

0

I am trying to test the render method in a controller with RSpec (2.x). Here the code in my controller:

respond_to do |format|
  format.html # index.html.erb
  format.json { render :json => @entities, :include => :properties, :overview => options[:overview] }
end

And here the test I try in my spec file:

controller.should_receive(:render).with( hash_including(:overview => true) )

The problem is that RSpec tells me that no arguments are provided for render ("got: (no args)"). Not even the :json one. How do I stub the render method correctly?