shared_examples_for "a template that renders the messages/form
partial" do
it "renders the messages/form partial" do
view.should_receive(:_render_partial).
with(hash_including(:partial => "form"))
render
end
end
# new.html.erb
<%= render "sidebar", :recent_messages => @recent_messages %>
<%= render "form", :message => @message %>
7) messages/new.html.erb renders the messages/form partial
Failure/Error: Unable to find matching line from backtrace
#<ActionView::Base:0x000001014fbc88> received :_render_partial
with unexpected arguments
expected: (hash_including(:partial=>"form"))
got:
({:partial=>"sidebar", :locals=>{:recent_messages=>[]}})
So what to do if I call multiple partials from my view?
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users