Skip to content

Commit

Permalink
show rescuable exceptions for system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diebas committed Jan 14, 2025
1 parent c0808a8 commit d0dd51f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
config.active_record.migration_error = :page_load

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = :rescuable
config.action_dispatch.show_exceptions = false

# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
Expand Down
9 changes: 9 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ def facilities_route
end
end

config.around(:each, :show_rescuable_exceptions) do |example|
Rails.application.config.tap do |app_config|
prev_val = app_config.action_dispatch.show_exceptions
app_config.action_dispatch.show_exceptions = :rescuable
example.run
app_config.action_dispatch.show_exceptions = prev_val
end
end

require "rspec/active_job"
config.include(RSpec::ActiveJob)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/system/kiosk_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "rails_helper"

RSpec.describe "Launching Kiosk View", :js, :disable_requests_local, feature_setting: { kiosk_view: true, bypass_kiosk_auth: false } do
RSpec.describe "Launching Kiosk View", :js, :disable_requests_local, :show_rescuable_exceptions, feature_setting: { kiosk_view: true, bypass_kiosk_auth: false } do
let(:facility) { create(:setup_facility, kiosk_enabled: true) }
let(:account) { create(:setup_account) }
let!(:account_user) { FactoryBot.create(:account_user, :purchaser, account: account, user: user) }
Expand Down

0 comments on commit d0dd51f

Please sign in to comment.