KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In my helper module, I have: def abc(url) ... if request.env['HTTP_USER_AGENT'] do something end end In my spec file, I have: 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 When I run the spec I have this error: undefined local variable or method `request' for <ObjectWithDocHelperMixedIn:0x00000103b5a7d0> How do I stub for request.env['...'] in my specs? Thanks.
Tags (comma-separated)
Save Edits
Cancel