Module: Rspec::Rails23::Controllers

Defined in:
lib/rspec/rails23/controllers.rb

Defined Under Namespace

Modules: InstanceMethods, RenderOverrides, TemplateIsolationExtensions

Class Method Summary collapse

Class Method Details

.extended(extended_behaviour) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rspec/rails23/controllers.rb', line 70

def self.extended(extended_behaviour)
  extended_behaviour.send :include, ::ActionController::TestProcess, InstanceMethods, ::Rspec::Rails23::Matchers::Controllers
  extended_behaviour.describes.send :include, RenderOverrides, ::ActionController::TestCase::RaiseActionExceptions

  extended_behaviour.before do
    @request = ::ActionController::TestRequest.new
    @response = ::ActionController::TestResponse.new
    @controller = self.class.describes.new

    @controller.request = @request
    @controller.params = {}
    @controller.send(:initialize_current_url)
  end

end