From 3e6db7fda440e0ce18a3b5910691d0ee62a17b6e Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 24 Oct 2023 10:15:30 +1100 Subject: [PATCH] Update spec of changed report link The link now contains the local test server instead of some fake domain. --- spec/system/admin/reports_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 33a29028da..2547e59c2f 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -80,14 +80,13 @@ describe ' email = ActionMailer::Base.deliveries.last expect(email.body).to have_link( "customers", - href: %r"^http://test\.host/rails/active_storage/disk/.*/customers_[0-9]+\.html$" + href: %r"^http://.*/rails/active_storage/disk/.*/customers_[0-9]+\.html$" ) # 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]) + report_link = parsed_email.find(:link, "customers")[:href] content = URI.parse(report_link).read expect(content).to match "\nFirst Name\n"