mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 11:42:19 -05:00
17 lines
724 B
Ruby
17 lines
724 B
Ruby
RSpec.configure do |config|
|
|
config.around(:each, type: :request) do |example|
|
|
# Make Rails respond to errors like it would in production
|
|
env_config = Rails.application.env_config
|
|
original_show_exceptions = env_config["action_dispatch.show_exceptions"]
|
|
original_show_detailed_exceptions = env_config["action_dispatch.show_detailed_exceptions"]
|
|
env_config["action_dispatch.show_exceptions"] = true
|
|
env_config["action_dispatch.show_detailed_exceptions"] = false
|
|
# Test
|
|
example.run
|
|
ensure
|
|
# Restore config
|
|
env_config["action_dispatch.show_exceptions"] = original_show_exceptions
|
|
env_config["action_dispatch.show_detailed_exceptions"] = original_show_detailed_exceptions
|
|
end
|
|
end
|