elliottg
2010-Mar-30 21:03 UTC
[Rails] undefined local variable or method `request'—in test
I am working on a small gem patch... The code in question is in a module within /lib. I am calling request.env[''HTTP_REFERER''] and getting the desired results as implementation in the dev env. However, when I run my RSpec spec, I get: undefined local variable or method `request'' for #<Spec::Example::ExampleGroup::Subclass_1::Subclass_1:0x10057d518> I am assuming that somehow "request" is not getting initialized when in the test env. etc... Coming from the test/unit and Shoulda world, I know very little about RSpec, perhaps this is playing a role in my problem as well. Any insight here? Thanks! Elliott G -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
elliottg
2010-Mar-31 17:23 UTC
[Rails] Re: undefined local variable or method `request'—in test
Any thoughts on this one guys? Thanks On Mar 30, 5:03 pm, elliottg <x...-+PdThUrr9bOXUBVsB0ZYTw@public.gmane.org> wrote:> I am working on a small gem patch... The code in question is in a > module within /lib. I am calling request.env[''HTTP_REFERER''] and > getting the desired results as implementation in the dev env. > > However, when I run my RSpec spec, I get: > undefined local variable or method `request'' for > #<Spec::Example::ExampleGroup::Subclass_1::Subclass_1:0x10057d518> > > I am assuming that somehow "request" is not getting initialized when > in the test env. etc... Coming from the test/unit and Shoulda world, I > know very little about RSpec, perhaps this is playing a role in my > problem as well. > > Any insight here? > > Thanks! > Elliott G-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.