I can test my controller to render a certain layout with
expect { get :index }.to render_template(layout: 'my_layout')
But how can I test the controller to render NO layout?
The following first expectation passes, but be careful: the second expectation also passes! (testing the same code)
expect { get :index }.to render_template(layout: false)
expect { get :index }.to render_template(layout: true)
In Nov 2008, @david-chelimsky said:
One way I've handled this successfully is to integrate_views for this one example (in its own group) and specify that html elements from the layout are not present in the form. It's a brittle example, but it's only one.
I dont want to check the rendered view, but I did not find any better solution so far.
Does someone has a good approach?