Skip to content

Commit 2f5cdec

Browse files
KludgeKMLandysellick
authored andcommitted
Update tests
- Add override data to support publication test - Update tests to make more relevant
1 parent fbada61 commit 2f5cdec

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

test/integration/publication_test.rb

+29-3
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,38 @@ class PublicationTest < ActionDispatch::IntegrationTest
3232
assert_footer_has_published_dates("Published 3 May 2016")
3333
end
3434

35-
test "renders document attachments (as-is and directly)" do
36-
setup_and_visit_content_item("publication")
35+
test "does not render non-featured attachments" do
36+
overrides = {
37+
"details" => {
38+
"attachments" => [{
39+
"accessible" => false,
40+
"alternative_format_contact_email" => "[email protected]",
41+
"attachment_type" => "file",
42+
"command_paper_number" => "",
43+
"content_type" => "application/pdf",
44+
"file_size" => 123_456,
45+
"filename" => "veolia-permit.pdf",
46+
"hoc_paper_number" => "",
47+
"id" => "violia-permit",
48+
"isbn" => "",
49+
"locale" => "en",
50+
"title" => "Permit: Veolia ES (UK) Limited",
51+
"unique_reference" => "",
52+
"unnumbered_command_paper" => false,
53+
"unnumbered_hoc_paper" => false,
54+
"url" => "https://assets.publishing.service.gov.uk/media/123abc/veolia-permit.zip",
55+
}],
56+
"featured_attachments" => [],
57+
},
58+
}
59+
60+
setup_and_visit_content_item("publication", overrides)
3761
within "#documents" do
38-
assert page.has_text?("Permit: Veolia ES (UK) Limited")
62+
assert page.has_no_text?("Permit: Veolia ES (UK) Limited")
3963
end
64+
end
4065

66+
test "renders featured document attachments using components" do
4167
setup_and_visit_content_item("publication-with-featured-attachments")
4268
within "#documents" do
4369
assert page.has_text?("Number of ex-regular service personnel now part of FR20")

0 commit comments

Comments
 (0)