Module: RSpec::Rails::ControllerExampleGroup Private
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActionController::TestCase::Behavior, Matchers::RedirectTo, Matchers::RenderTemplate, Matchers::RoutingMatchers, RailsExampleGroup, ViewRendering
- Defined in:
- lib/rspec/rails/example/controller_example_group.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Container module for controller spec functionality.
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
- #controller ⇒ Object readonly private
- #routes ⇒ Object readonly private
Instance Method Summary collapse
-
#bypass_rescue ⇒ Object
private
Extends the controller with a module that overrides
rescue_with_handler
to raise the exception passed to it. -
#method_missing(method, *args, &block) ⇒ Object
private
If method is a named_route, delegates to the RouteSet associated with this controller.
Methods included from Matchers::RoutingMatchers
Methods included from Matchers::RenderTemplate
Methods included from Matchers::RedirectTo
Methods included from ViewRendering
Methods included from Matchers
#be_a_new, #be_new_record, #be_valid, #have_http_status
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
If method is a named_route, delegates to the RouteSet associated with this controller.
160 161 162 163 164 165 166 |
# File 'lib/rspec/rails/example/controller_example_group.rb', line 160 def method_missing(method, *args, &block) if route_available?(method) controller.send(method, *args, &block) else super end end |
Instance Attribute Details
#controller ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
120 121 122 |
# File 'lib/rspec/rails/example/controller_example_group.rb', line 120 def controller @controller end |
#routes ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
120 121 122 |
# File 'lib/rspec/rails/example/controller_example_group.rb', line 120 def routes @routes end |
Instance Method Details
#bypass_rescue ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extends the controller with a module that overrides
rescue_with_handler
to raise the exception passed to it. Use this to
specify that an action should raise an exception given appropriate
conditions.
154 155 156 |
# File 'lib/rspec/rails/example/controller_example_group.rb', line 154 def bypass_rescue controller.extend(BypassRescue) end |