Reputation: 2382
Just curious. How is the @controller instance variable inside the controller specs being instantiated? And where?
Upvotes: 2
Views: 234
Reputation: 557
I believe this is actually being done by ActionController::TestCase::Behavior#setup_controller_request_and_response, which is wired up by RSpec::Rails::SetupAndTeardownAdapter#setup, which is included by RSpec::Rails::RailsExampleGroup and used by RSpec::Rails::ControllerExampleGroup. :)
bundle open rspec-rails
is an easy way to start looking at how this stuff works.
HTH!
Upvotes: 3