[rspec-devel] [ rspec-Patches-12701 ] Allow checking of content captured with content_for in view specs

noreply at rubyforge.org noreply at rubyforge.org
Mon Jul 30 17:15:46 EDT 2007


Patches item #12701, was opened at 2007-07-30 23: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: Open
Resolution: None
Priority: 3
Submitted By: Jens Krämer (jkraemer)
Assigned to: Nobody (None)
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



----------------------------------------------------------------------

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