Module: ActionController::Rescue

Defined in:
lib/spec/rails/extensions/action_controller/rescue.rb

Instance Method Summary collapse

Instance Method Details

#use_rails_error_handling!Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/spec/rails/extensions/action_controller/rescue.rb', line 3

def use_rails_error_handling!
  Kernel.warn <<-WARNING
DEPRECATION NOTICE: controller.use_rails_error_handling! is
deprecated and will be removed from a future version of
rspec-rails.

Use rescue_action_in_public!, which is defined directly in
rails' testing framework, instead.
WARNING
  if ::Rails::VERSION::STRING =~ /^2\.0/
    @use_rails_error_handling = true
  else
    # anything but 0.0.0.0 - borrowed from rails own rescue_action_in_public!
    request.remote_addr = '208.77.188.166'
  end
end

#use_rails_error_handling?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/spec/rails/extensions/action_controller/rescue.rb', line 20

def use_rails_error_handling?
  @use_rails_error_handling ||= false
end