Files
ulferts 8c73781898 adapt specs for pdf content type
Chrome has been migrating its built-in PDF viewer from GuestView (separate WebContents with an <embed> element) to OOPIF (Out-of-Process Iframe). Chrome 145 appears to be where this became the default.
2026-02-18 08:47:39 +01:00

25 lines
589 B
Ruby

# frozen_string_literal: true
require "spec_helper"
require "pdf/inspector"
module PDFExportSpecUtils
def column_title(column_name)
label_title(column_name)
end
def label_title(column_name)
if column_name.start_with?("cf_")
id = column_name.delete_prefix("cf_").to_i
return ::CustomField.find(id).name
end
WorkPackage.human_attribute_name(column_name)
end
def expect_current_url_to_be_pdf
uri = URI.parse(page.current_url)
response = Net::HTTP.get_response(uri)
expect(response["Content-Type"]).to include("application/pdf")
end
end