This question is NOT about how to test controllers in a rails app.
Developing a gem I want to test if my gem integrates in a rails controller. So running rspec in the gem root is outside the rails environment.
Now how do I write say a controller test which can use the rspec controller example group helpers like get
or post
?
IN particular if I set a metatag :type => :controller
on an example group , how does rspec set up the rails environment and how can i hook into that in order to say set up routes, etc.
I'd rather not have to set up an entire rails app skeleton mostly empty. But I cannot even find info on how to do that. What is best practice to test a gem integrating to rails app or multiple frameworks.
These sources came closest to what I am after: Test (with RSpec) a controller outside of a Rails environment but this is for test unit. http://railsware.com/blog/2012/01/07/testing-gem-integration-with-multiple-ruby-frameworks/ but this is for capybara which directly hooks in a rails app class.
thanks all