In ApplicationHelper I have such code:
def inside_layout layout = 'application', &block
@template.instance_variable_set '@content_for_layout', capture(&block)
concat \
@template.render :file => "layouts/#{layout}", :use_full_path => true
end
which behaves like this:
application.html.haml:
!!!
%html
%head
...
%body
= yield
common_pages.html.haml:
- inside_layout do
...
Then common_pages layout render within application layout.
How I can test this helper with RSpec?
When I call inside_layout from spec file:
helper.inside_layout { }
RSpec says error:
ActionView::MissingTemplate in 'ApplicationHelper inside_layout should render nested layout within application layout'
Missing layout layouts/application.erb in view path
But application works fine.