[rspec-users] nested layouts

Jonathan Linowes jonathan at parkerhill.com
Sat Aug 11 08:52:36 EDT 2007


hi,

I'm using a helper like in nested-layouts plugin as follows

   def inside_layout(layout, &block)
     layout = layout.include?('/') ? layout : "layouts/#{layout}"
     @template.instance_variable_set('@content_for_layout', capture 
(&block))
     concat(
       @template.render( :file => layout, :user_full_path => true ),
       block.binding
     )
   end


used like this:

views/layouts/bar.html.erb:

<% inside_layout 'foo' do -%>
   ...stuff...
<% end %>

This basically works in my view spec although it brings in all the  
nested (outer) layouts

Can you suggest a way to isolate the bar.html.erb template?

thanks



More information about the rspec-users mailing list