I just solved the problem by including the below code in my acceptance
helper. If you are not Steak then just simply put it in spec helper or
require it from somewhere else. post and xhr methods are now available
in that spec regardless in what spec it is or in what directory you
are.
The code is derived from RSpec::Rails::RequestExampleGroup
<pre>
RSpec::Core::ExampleGroup.class_eval do
include ActiveSupport::Concern
include ActionDispatch::Integration::Runner
include RSpec::Rails::BrowserSimulators
def app
::Rails.application
end
def last_response
response
end
end
</pre>
On Nov 17, 3:01 am, turkan
<kai.schl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> I''d like to use the request helpers
> (ActionDispatch::Integration::RequestHelpers
> ) outside of my RSpec controller tests (in other RSpec tests), but I
> don''t know how to include and use them there.
>
> Best regards,
> Kai
--
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.