Module: RescueRegistry::RailsTestHelpers

Defined in:
lib/rescue_registry/rails_test_helpers.rb

Overview

Helpers to improve the ease of testing error handling in Rails tests. These are not actually specific to RescueRegistry, but will certainly be useful for it.

Instance Method Summary collapse

Instance Method Details

#handle_request_exceptions(handle = true, &block) ⇒ Object



5
6
7
# File 'lib/rescue_registry/rails_test_helpers.rb', line 5

def handle_request_exceptions(handle = true, &block)
  set_action_dispatch_property(:show_exceptions, handle, &block)
end

#handle_request_exceptions?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/rescue_registry/rails_test_helpers.rb', line 9

def handle_request_exceptions?
  Rails.application.config.action_dispatch.show_exceptions
end

#show_detailed_exceptions(show = true, &block) ⇒ Object



13
14
15
# File 'lib/rescue_registry/rails_test_helpers.rb', line 13

def show_detailed_exceptions(show = true, &block)
  set_action_dispatch_property(:show_detailed_exceptions, show, &block)
end

#show_detailed_exceptions?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rescue_registry/rails_test_helpers.rb', line 17

def show_detailed_exceptions?
  Rails.application.config.action_dispatch.show_detailed_exceptions
end