[rspec-users] RSpec 2/Rails 3 - content_for in view specs

Michael Schuerig michael at schuerig.de
Sat Aug 28 19:12:53 EDT 2010

On Thursday 19 August 2010, Dylan Markow wrote:
> Is there a way to get to the content captured in a "content_for"
> block through my view specs, or at the very least get my "render"
> call to use the full layout?

Try defining a method like this in your spec

  def content_for(name)

and then

  content_for(:sidebar).should ...


Michael Schuerig
mailto:michael at schuerig.de

More information about the rspec-users mailing list