-
Notifications
You must be signed in to change notification settings - Fork 17
/
corporate_information_page_test.rb
58 lines (50 loc) · 1.97 KB
/
corporate_information_page_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
require 'test_helper'
class CorporateInformationPageTest < ActionDispatch::IntegrationTest
test "renders title, description and body" do
setup_and_visit_content_item('corporate_information_page')
assert_has_component_title(@content_item["title"])
assert page.has_text?(@content_item["description"])
assert_has_component_govspeak(@content_item["details"]["body"])
assert_has_contents_list([
{ text: "Our responsibilities", id: "our-responsibilities" },
])
end
test "renders with organisation branding" do
setup_and_visit_content_item('corporate_information_page')
assert page.has_css?('.department-of-health-brand-colour')
end
test "includes organisation in title" do
setup_and_visit_content_item('corporate_information_page')
assert page.has_css?('title', text: 'About us - Department of Health - GOV.UK', visible: false)
end
test "includes translations" do
setup_and_visit_content_item('corporate_information_page_translated_custom_logo')
assert page.has_css?('.available-languages')
end
test "renders an organisation logo" do
setup_and_visit_content_item('corporate_information_page')
assert_has_component_organisation_logo(
organisation: {
name: 'Department<br/>of Health',
url: '/government/organisations/department-of-health',
brand: 'department-of-health',
crest: 'single-identity'
}
)
end
test "renders a custom organisation logo" do
setup_and_visit_content_item('corporate_information_page_translated_custom_logo')
assert_has_component_organisation_logo(
organisation: {
name: 'Land Registry',
url: '/government/organisations/land-registry',
brand: 'department-for-business-innovation-skills',
crest: nil,
image: {
url: 'https://assets.publishing.service.gov.uk/government/uploads/system/uploads/organisation/logo/69/LR_logo_265.png',
alt_text: 'Land Registry'
}
}
)
end
end