Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test regarding to GOVUK_ASSET_ROOT #8259

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ def govspeak_to_html(govspeak)
)
presented_item = present(organisation)

expected_image_url = "https://static.test.gov.uk" \
"/government/uploads/system/uploads/organisation/logo/#{organisation.logo.model.id}/960x640_jpeg.jpg"
expected_image_url = "#{Plek.asset_root}/government/uploads/system/uploads/organisation/logo/#{organisation.logo.model.id}/960x640_jpeg.jpg"

assert_equal(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def present(...)
worldwide_organisation: worldwide_org,
attachments: [create(:file_attachment)])
expected_body_text = "<div class=\"govspeak\"><p>Some stuff and some attachments"
expected_body_attachment_link = Regexp.new(/<a class="govuk-link" href="https:\/\/static.test.gov.uk\/government\/uploads\/system\/uploads\/attachment_data\/file\/\d+\/greenpaper.pdf">file-attachment-title-\d+<\/a>/)
expected_body_attachment_link = Regexp.new(/<a class="govuk-link" href="#{Plek.asset_root}\/government\/uploads\/system\/uploads\/attachment_data\/file\/\d+\/greenpaper.pdf">file-attachment-title-\d+<\/a>/)
expected_body_attachment_metadata = "(<span class=\"gem-c-attachment-link__attribute\"><abbr title=\"Portable Document Format\" class=\"gem-c-attachment-link__abbr\">PDF</abbr></span>, <span class=\"gem-c-attachment-link__attribute\">3.39 KB</span>, <span class=\"gem-c-attachment-link__attribute\">1 page</span>)"

presented_item = present(worldwide_org)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def stub_asset_downloads

# Stub requests for asset files
# and respond with the requested fixture file
urls_starting = "https://static.test.gov.uk/government/uploads/system/uploads/"
urls_starting = "#{Plek.asset_root}/government/uploads/system/uploads/"
stub_request(:get, %r{^#{Regexp.escape(urls_starting)}})
.to_return do |request|
fixture_name = request.uri.to_s.split("/").last
Expand Down