title: Rspec: how to spec request.env in a helper spec?
body: <p>In my helper module, I have:</p>
  
  <pre><code>def abc(url)
    ...
    if request.env['HTTP_USER_AGENT']
      do something
    end
  end
  </code></pre>
  
  <p>In my spec file, I have:</p>
  
  <pre><code>  describe "#abc" do      
  before(:each) do
    @meth = :abc
  
    helper.request.env['HTTP_USER_AGENT'] = "..."
  end
  it "should return the webstart jnlp file" do
    @obj.send(@meth, "some_url").should ....
  end
  end
  </code></pre>
  
  <p>When I run the spec I have this error:</p>
  
  <pre><code>undefined local variable or method `request' for &lt;ObjectWithDocHelperMixedIn:0x00000103b5a7d0&gt;
  </code></pre>
  
  <p>How do I stub for request.env['...'] in my specs?</p>
  
  <p>Thanks.</p>