title: How to set the request.body for an Rspec request spec with a GET request
body: <ul>
  <li>rails 5.0.0.1 </li>
  <li>rspec 3.5</li>
  </ul>
  
  <p>I have inherited a code base. I am busy writing integration tests to tie down the app functionality before I consider refactoring. </p>
  
  <p>I have the following lines in a controller concern <code>before_action</code>. It seems to read the request body. The <code>json</code> value here is used to extract an identifier used to authenticate the request. </p>
  
  <pre><code>request.body.rewind
  body = request.body.read
  json = JSON.parse(body) unless body.empty?
  </code></pre>
  
  <p>I need to test that the authentication happens correctly. 
  How can I set the <code>request.body</code> for a GET request spec? </p>