title: Rspec test to render no layout
body: <p>I can test my controller to render a certain layout with</p>
  
  <pre><code>expect { get :index }.to render_template(layout: 'my_layout')
  </code></pre>
  
  <p>But how can I test the controller to render NO layout?</p>
  
  <p>The following first expectation passes, <strong>but be careful</strong>: the second expectation also passes! (testing the same code)</p>
  
  <pre><code>expect { get :index }.to render_template(layout: false)
  expect { get :index }.to render_template(layout: true)
  </code></pre>
  
  <p>In Nov 2008, @david-chelimsky said:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>I dont want to check the rendered view, but I did not find any better solution so far.</p>
  
  <p>Does someone has a good approach?</p>