Skip to content

Commit

Permalink
Linting auto-correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Thorner committed May 6, 2020
1 parent fc9016e commit 941a008
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion test/components/important_metadata_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def component_name
render_component(
title: "The release date has been changed",
items: {
"Release Date": "14 October 2016",
"Release Date": "14 October 2016",
},
)

Expand Down
34 changes: 17 additions & 17 deletions test/presenters/content_item/parts_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,22 @@ def content_item
end

assert_equal @parts.parts_navigation, [
[
"first-title", "<a class=\"govuk-link\" data-track-category=\"contentsClicked\" "\
"data-track-action=\"content_item 2\" data-track-label=\"/base-path/second-slug\" "\
"data-track-options=\"{&quot;dimension29&quot;:&quot;second-title&quot;}\" "\
"href=\"/base-path/second-slug\">second-title</a>"
],
[
"<a class=\"govuk-link\" data-track-category=\"contentsClicked\" data-track-action=\"content_item 3\" "\
"data-track-label=\"/base-path/third-slug\" "\
"data-track-options=\"{&quot;dimension29&quot;:&quot;third-title&quot;}\" "\
"href=\"/base-path/third-slug\">third-title</a>",
"<a class=\"govuk-link\" data-track-category=\"contentsClicked\" data-track-action=\"content_item 4\" "\
"data-track-label=\"/base-path/fourth-slug\" "\
"data-track-options=\"{&quot;dimension29&quot;:&quot;fourth-title&quot;}\" "\
"href=\"/base-path/fourth-slug\">fourth-title</a>",
],
]
[
"first-title", "<a class=\"govuk-link\" data-track-category=\"contentsClicked\" "\
"data-track-action=\"content_item 2\" data-track-label=\"/base-path/second-slug\" "\
"data-track-options=\"{&quot;dimension29&quot;:&quot;second-title&quot;}\" "\
"href=\"/base-path/second-slug\">second-title</a>"
],
[
"<a class=\"govuk-link\" data-track-category=\"contentsClicked\" data-track-action=\"content_item 3\" "\
"data-track-label=\"/base-path/third-slug\" "\
"data-track-options=\"{&quot;dimension29&quot;:&quot;third-title&quot;}\" "\
"href=\"/base-path/third-slug\">third-title</a>",
"<a class=\"govuk-link\" data-track-category=\"contentsClicked\" data-track-action=\"content_item 4\" "\
"data-track-label=\"/base-path/fourth-slug\" "\
"data-track-options=\"{&quot;dimension29&quot;:&quot;fourth-title&quot;}\" "\
"href=\"/base-path/fourth-slug\">fourth-title</a>",
],
]
end
end
96 changes: 48 additions & 48 deletions test/presenters/specialist_document_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class PresentedSpecialistDocument < SpecialistDocumentTestCase
test "has title without context" do
assert presented_item("aaib-reports").is_a?(ContentItem::TitleAndContext)
title_component_params = {
title: schema_item("aaib-reports")["title"],
context_locale: nil,
average_title_length: "long",
title: schema_item("aaib-reports")["title"],
context_locale: nil,
average_title_length: "long",

}
}

assert_equal title_component_params, presented_item("aaib-reports").title_and_context
end
Expand Down Expand Up @@ -215,17 +215,17 @@ def example_facet(overrides = {})

test "ignores facets if valid key but set to an empty string" do
example = example_with_finder_facets([
{
"name" => "Facet name",
"key" => "facet-key",
"type" => "text",
},
{
"name" => "Date facet",
"key" => "date-facet",
"type" => "date",
},
],
{
"name" => "Facet name",
"key" => "facet-key",
"type" => "text",
},
{
"name" => "Date facet",
"key" => "date-facet",
"type" => "date",
},
],
"facet-key" => "",
"date-facet" => "")

Expand Down Expand Up @@ -283,27 +283,27 @@ def example_facet(overrides = {})

test "puts date facets together and before text facets" do
example = example_with_finder_facets([
{
"name" => "Facet name",
"key" => "facet-key",
"type" => "text",
},
{
"name" => "First date facet",
"key" => "first-date-facet",
"type" => "date",
},
{
"name" => "Second date facet",
"key" => "second-date-facet",
"type" => "date",
},
{
"name" => "More text",
"key" => "more-text",
"type" => "text",
},
],
{
"name" => "Facet name",
"key" => "facet-key",
"type" => "text",
},
{
"name" => "First date facet",
"key" => "first-date-facet",
"type" => "date",
},
{
"name" => "Second date facet",
"key" => "second-date-facet",
"type" => "date",
},
{
"name" => "More text",
"key" => "more-text",
"type" => "text",
},
],
"facet-key" => "Text",
"first-date-facet" => "2010-01-01",
"second-date-facet" => "2010-02-03",
Expand All @@ -327,12 +327,12 @@ def example_facet(overrides = {})

test "omits first_published_at facet values from `other` section of component parameters to avoid duplicates" do
facets = [
{
"name" => "Published",
"key" => "first_published_at",
"type" => "date",
},
]
{
"name" => "Published",
"key" => "first_published_at",
"type" => "date",
},
]
example = example_with_finder_facets(facets, "first_published_at" => "2010-01-01")

presented = present_example(example)
Expand All @@ -341,12 +341,12 @@ def example_facet(overrides = {})

test "uses first published date in facets as canonical publish date if provided" do
facets = [
{
"name" => "Published",
"key" => "first_published_at",
"type" => "date",
},
]
{
"name" => "Published",
"key" => "first_published_at",
"type" => "date",
},
]
example = example_with_finder_facets(facets, "first_published_at" => "2010-01-01")

example["details"]["change_history"] = [
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/speech_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def example_schema_name
"<a class=\"govuk-link\" href=\"/government/organisations/prime-ministers-office-10-downing-street\">Prime Minister&#39;s Office, 10 Downing Street</a>",
"<a class=\"govuk-link\" href=\"/government/organisations/cabinet-office\">Cabinet Office</a>",
"Her Majesty the Queen",
], presented_item(example_schema_name).from
], presented_item(example_schema_name).from
end
end
end
14 changes: 7 additions & 7 deletions test/presenters/topical_event_about_page_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def schema_name

test "presents a list of contents extracted from headings in the body" do
assert_equal [
{ text: "Response in the UK", id: "response-in-the-uk", href: "#response-in-the-uk" },
{ text: "Response in Africa", id: "response-in-africa", href: "#response-in-africa" },
{ text: "Advice for travellers", id: "advice-for-travellers", href: "#advice-for-travellers" },
{ text: "Advice for medics", id: "advice-for-medics", href: "#advice-for-medics" },
{ text: "Advice for aid workers", id: "advice-for-aid-workers", href: "#advice-for-aid-workers" },
{ text: "How you can help", id: "how-you-can-help", href: "#how-you-can-help" },
], presented_item.contents
{ text: "Response in the UK", id: "response-in-the-uk", href: "#response-in-the-uk" },
{ text: "Response in Africa", id: "response-in-africa", href: "#response-in-africa" },
{ text: "Advice for travellers", id: "advice-for-travellers", href: "#advice-for-travellers" },
{ text: "Advice for medics", id: "advice-for-medics", href: "#advice-for-medics" },
{ text: "Advice for aid workers", id: "advice-for-aid-workers", href: "#advice-for-aid-workers" },
{ text: "How you can help", id: "how-you-can-help", href: "#how-you-can-help" },
], presented_item.contents
end

test "presents no contents when no headings in the body" do
Expand Down
6 changes: 3 additions & 3 deletions test/services/world_location_base_path_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class WorldLocationBasePathWithoutBasePath < ActiveSupport::TestCase

class WorldLocationBasePathForExceptionalCase < ActiveSupport::TestCase
{
"Democratic Republic of Congo" => "democratic-republic-of-congo",
"South Georgia and the South Sandwich Islands" => "south-georgia-and-the-south-sandwich-islands",
"St Pierre & Miquelon" => "st-pierre-miquelon",
"Democratic Republic of Congo" => "democratic-republic-of-congo",
"South Georgia and the South Sandwich Islands" => "south-georgia-and-the-south-sandwich-islands",
"St Pierre & Miquelon" => "st-pierre-miquelon",
}.each do |title, expected_slug|
test "returns /world/#{expected_slug}/news" do
link = {
Expand Down

0 comments on commit 941a008

Please sign in to comment.