[rspec-devel] [ rspec-Patches-12701 ] Allow checking of content captured with content_for in view specs
noreply at rubyforge.org
noreply at rubyforge.org
Sat Aug 4 09:48:01 EDT 2007
Patches item #12701, was opened at 2007-07-30 21:15
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=12701&group_id=797
Category: rails plugin
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Jens Krämer (jkraemer)
>Assigned to: David Chelimsky (dchelimsky)
Summary: Allow checking of content captured with content_for in view specs
Initial Comment:
This patch extends ActionController::TestResponse with an accessor to get any content rendered inside a content_for block so it can easily be checked like the template's main content:
<% content_for :sidebar do %>
<h2>The sidebar</h2>
<% end %>
it "should render the sidebar" do
response[:sidebar].should have_tag('h2', 'The sidebar')
end
----------------------------------------------------------------------
>Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-04 13:48
Message:
Nice patch.
Applied to r2242.
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=12701&group_id=797
More information about the rspec-devel
mailing list