Module: Rspec::Rails23::Controllers::InstanceMethods

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



9
10
11
# File 'lib/rspec/rails23/controllers.rb', line 9

def controller
  @controller
end

#requestObject (readonly)

Returns the value of attribute request.



9
10
11
# File 'lib/rspec/rails23/controllers.rb', line 9

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/rspec/rails23/controllers.rb', line 9

def response
  @response
end

Instance Method Details

#params_from(method, path) ⇒ Object



16
17
18
19
# File 'lib/rspec/rails23/controllers.rb', line 16

def params_from(method, path)
  ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
  ActionController::Routing::Routes.recognize_path(path, :method => method)
end

#route_for(options) ⇒ Object



11
12
13
14
# File 'lib/rspec/rails23/controllers.rb', line 11

def route_for(options)
  ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
  ActionController::Routing::Routes.generate(options)
end