Skip to content

Commit d397d13

Browse files
committed
Remove deprecated section meta tags.
1 parent f6d8013 commit d397d13

6 files changed

+1
-46
lines changed

app/presenters/flow_registration_presenter.rb

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ def title
1717
lookup_translation("title") || @flow.name.to_s.humanize
1818
end
1919

20-
def section
21-
lookup_translation("section") || @flow.section_slug.try(:humanize)
22-
end
23-
2420
def paths
2521
[@flow.name, "#{@flow.name}.json"]
2622
end

app/presenters/smart_answer_presenter.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SmartAnswerPresenter
88

99
attr_reader :request, :params, :flow
1010

11-
def_delegators :@flow, :section_slug, :subsection_slug, :need_id
11+
def_delegators :@flow, :need_id
1212

1313
def initialize(request, flow)
1414
@request = request
@@ -39,10 +39,6 @@ def title
3939
lookup_translation(:title) || @flow.name.to_s.humanize
4040
end
4141

42-
def section_name
43-
lookup_translation(:section_name) || @flow.section_slug.to_s.humanize
44-
end
45-
4642
def subtitle
4743
lookup_translation(:subtitle)
4844
end

app/views/layouts/application.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<title><%= yield :title %> | GOV.UK</title>
55
<%= javascript_include_tag "smart-answers", defer: true %>
6-
<%= yield :section_meta_tags %>
76
<%= yield :head %>
87
</head>
98
<body class="mainstream">

app/views/smart_answers/show.html.erb

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
<% content_for :title do %><%= @presenter.title %><% end %>
2-
<% content_for :section_meta_tags do %>
3-
<meta name="x-section-name" content="<%= @presenter.section_name %>" />
4-
<meta name="x-section-link" content="/browse/<%= @presenter.section_slug %>" />
5-
<meta name="x-section-format" content="smart_answer" />
6-
<% end %>
72
<section id="content"<% if @presenter.started? %> class="smart-answer-questions group"<% end %>>
83
<%= render partial: "content" %>
94
</section>

test/functional/smart_answers_controller_test.rb

-14
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ def submit_json_response(response = nil, other_params = {})
9595
assert_select "head meta[name=robots][content=noindex]"
9696
end
9797

98-
should "send slimmer section meta tags" do
99-
get :show, id: 'sample'
100-
assert_select "head meta[name=x-section-name][content=Family]"
101-
assert_select "head meta[name=x-section-link][content=/browse/family]"
102-
end
103-
10498
should "send the artefact to slimmer" do
10599
artefact = artefact_for_slug('sample')
106100
SmartAnswerPresenter.any_instance.stubs(:artefact).returns(artefact)
@@ -109,14 +103,6 @@ def submit_json_response(response = nil, other_params = {})
109103
get :show, id: 'sample'
110104
end
111105

112-
should "look up section name in translation file" do
113-
using_translation_file(fixture_file('smart_answers_controller_test/section_name.yml')) do
114-
get :show, id: 'sample'
115-
end
116-
assert_select 'head meta[name=x-section-name][content="Section Name From Translation File"]'
117-
assert_select "head meta[name=x-section-link][content=/browse/family]"
118-
end
119-
120106
should "send slimmer analytics headers" do
121107
get :show, id: 'sample'
122108
assert_equal "smart_answer", @response.headers["X-Slimmer-Format"]

test/unit/flow_registration_presenter_test.rb

-17
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,6 @@ def teardown
4141
end
4242
end
4343

44-
context "section" do
45-
should "use the translated section_name" do
46-
assert_equal "SECTION", @presenter.section
47-
end
48-
49-
should "use the humanized section_slug if no translation is available" do
50-
I18n.stubs(:translate!).raises(I18n::MissingTranslationData.new(:en, "anything", {}))
51-
assert_equal "Sample", @presenter.section
52-
end
53-
54-
should "return nil if there is no translation, and no section_slug defined" do
55-
I18n.stubs(:translate!).raises(I18n::MissingTranslationData.new(:en, "anything", {}))
56-
@flow.stubs(:section_slug).returns(nil)
57-
assert_equal nil, @presenter.section
58-
end
59-
end
60-
6144
context "paths" do
6245
should "generate flow.name and flow.name.json" do
6346
assert_equal ["flow-sample", "flow-sample.json"], @presenter.paths

0 commit comments

Comments
 (0)