Display a friendly message when a report times out

Once we get a download link for a report, we can display this message
sooner. But for now we just use the existing request timeout.
This commit is contained in:
Maikel Linke
2023-03-28 10:49:07 +11:00
parent 3bd8e430f9
commit 00a3976905
4 changed files with 29 additions and 2 deletions

View File

@@ -44,6 +44,19 @@ describe '
click_button "Go"
expect(page).to have_content "EMAIL FIRST NAME"
end
it "displays a friendly timeout message" do
ActiveJob::Base.queue_adapter.perform_enqueued_jobs = false
login_as_admin_and_visit admin_report_path(
report_type: :customers, report_subtype: :mailing_list
)
expect_any_instance_of(Admin::ReportsController).to receive(:sleep).
and_raise(Rack::Timeout::RequestTimeoutException.new(nil))
click_button "Go"
expect(page).to have_content "This report is taking longer to process."
end
end
describe "Can access Customers reports and generate customers report" do