title: Rails/rspec: how to set cookies in a request spec?
body: <p>How do I set cookies in my request specs?</p>
  
  <p>The solutions on the following page did not work:</p>
  
  <p><a href="https://stackoverflow.com/questions/5475989/rspec-setting-cookies-in-a-helper-test">Rspec: setting cookies in a helper test</a></p>
  
  <p>Namely, <code>request.cookies[:whatever] = 'something'</code> says that <code>request</code> is a <code>nil</code> object. I also tried <code>helper.cookies[:whatever] = 'something'</code>, and that also did not work (<code>helper</code> in that case was <code>nil</code>).</p>