diff --git a/config/locales/en.yml b/config/locales/en.yml index 84e3ec6c68..0943956e69 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1472,7 +1472,7 @@ en: report_taking_longer_html: > This report is taking longer to process. It may contain a lot of data or we are busy with other reports. - Once it's finished, you can download it: %{link} + Once it's finished, we'll notify you via email. report_link_label: Download report (when available) revenues_by_hub: name: Revenues By Hub diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index b3ff6a8dfc..98edf6ed45 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -88,23 +88,6 @@ describe ' perform_enqueued_jobs(only: ReportJob) - click_link "Download report" - - expect(downloaded_filename).to match /customers_[0-9]+\.html/ - - content = File.read(downloaded_filename) - expect(content).to match "\nFirst Name\n" - - # ActiveStorage links usually expire after 5 minutes. - # We need a longer expiry for a better user experience. - # Let's test if the link still works after a few hours. - Timecop.travel(3.hours.from_now) do - expect do - File.delete(downloaded_filename) - click_link "Download report" - end.to_not change { downloaded_filename } - end - # We also get an email. perform_enqueued_jobs(only: ActionMailer::MailDeliveryJob) email = ActionMailer::Base.deliveries.last @@ -113,7 +96,8 @@ describe ' href: %r"^http://test\.host/rails/active_storage/disk/.*/customers_[0-9]+\.html$" ) - # We want to check that the emailed link works as well: + # ActiveStorage links usually expire after 5 minutes. + # But we want a longer expiry in emailed links. parsed_email = Capybara::Node::Simple.new(email.body.to_s) email_link_href = parsed_email.find(:link, "customers")[:href] report_link = email_link_href.sub("test.host", Rails.application.default_url_options[:host])