@@ -32,12 +32,38 @@ class PublicationTest < ActionDispatch::IntegrationTest
32
32
assert_footer_has_published_dates ( "Published 3 May 2016" )
33
33
end
34
34
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 )
37
61
within "#documents" do
38
- assert page . has_text ?( "Permit: Veolia ES (UK) Limited" )
62
+ assert page . has_no_text ?( "Permit: Veolia ES (UK) Limited" )
39
63
end
64
+ end
40
65
66
+ test "renders featured document attachments using components" do
41
67
setup_and_visit_content_item ( "publication-with-featured-attachments" )
42
68
within "#documents" do
43
69
assert page . has_text? ( "Number of ex-regular service personnel now part of FR20" )
0 commit comments