mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Update spec of changed report link
The link now contains the local test server instead of some fake domain.
This commit is contained in:
@@ -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 "<th>\nFirst Name\n</th>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user