From 8a3cf170aa42cf62f5196bb43ce943cc50fe210c Mon Sep 17 00:00:00 2001 From: Peter Hartshorn Date: Mon, 18 Sep 2023 17:13:29 +0100 Subject: [PATCH] Updates placeholder references The placeholder schema was removed in [1] [1]: https://github.com/alphagov/publishing-api/pull/2493 --- spec/features/contextual_navigation_spec.rb | 4 ++-- spec/features/step_nav_helper_spec.rb | 2 +- .../content_breadcrumbs_based_on_ancestors_spec.rb | 4 ++-- .../presenters/related_navigation_helper_spec.rb | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/features/contextual_navigation_spec.rb b/spec/features/contextual_navigation_spec.rb index 61b5221573..13c48d1b87 100644 --- a/spec/features/contextual_navigation_spec.rb +++ b/spec/features/contextual_navigation_spec.rb @@ -325,7 +325,7 @@ def given_there_is_a_non_step_by_step_parent_page end def not_step_by_step_content - not_step_by_step_content = random_item("placeholder") + not_step_by_step_content = random_item("generic") not_step_by_step_content["links"].delete("part_of_step_navs") not_step_by_step_content["links"].delete("secondary_to_step_navs") not_step_by_step_content @@ -341,7 +341,7 @@ def given_there_is_a_parent_page_with_two_taxon def given_there_is_a_parent_page_with_a_step_by_step step_by_step = random_step_nav_item("step_by_step_nav").merge("title" => "A step by step page") - @parent = random_item("placeholder") + @parent = random_item("generic") @parent["links"]["part_of_step_navs"] = [step_by_step] @parent["links"].delete("finder") end diff --git a/spec/features/step_nav_helper_spec.rb b/spec/features/step_nav_helper_spec.rb index 5292be2b2e..93a9492a9a 100644 --- a/spec/features/step_nav_helper_spec.rb +++ b/spec/features/step_nav_helper_spec.rb @@ -114,7 +114,7 @@ end end - def content_store_has_random_item(base_path:, schema: "placeholder", part_of_step_navs: []) + def content_store_has_random_item(base_path:, schema: "generic", part_of_step_navs: []) links = if part_of_step_navs { "part_of_step_navs" => part_of_step_navs } else diff --git a/spec/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors_spec.rb b/spec/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors_spec.rb index 2cc271e0dc..0cb221c798 100644 --- a/spec/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors_spec.rb +++ b/spec/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors_spec.rb @@ -3,7 +3,7 @@ RSpec.describe GovukPublishingComponents::Presenters::ContentBreadcrumbsBasedOnAncestors do describe "#breadcrumbs" do it "can handle any valid content item" do - payload = GovukSchemas::RandomExample.for_schema(frontend_schema: "placeholder") + payload = GovukSchemas::RandomExample.for_schema(frontend_schema: "generic") expect { described_class.new(payload).breadcrumbs }.to_not raise_error end @@ -87,7 +87,7 @@ def content_item_with_parents(parents) end def breadcrumbs_for(content_item) - fully_valid_content_item = GovukSchemas::RandomExample.for_schema(frontend_schema: "placeholder") do |random_item| + fully_valid_content_item = GovukSchemas::RandomExample.for_schema(frontend_schema: "generic") do |random_item| random_item.merge(content_item) end diff --git a/spec/lib/govuk_publishing_components/presenters/related_navigation_helper_spec.rb b/spec/lib/govuk_publishing_components/presenters/related_navigation_helper_spec.rb index c8e21f5612..603f922578 100644 --- a/spec/lib/govuk_publishing_components/presenters/related_navigation_helper_spec.rb +++ b/spec/lib/govuk_publishing_components/presenters/related_navigation_helper_spec.rb @@ -10,12 +10,12 @@ def payload_for(schema, content_item, context = nil) describe "#related_navigation" do it "can handle randomly generated content" do - expect { payload_for("placeholder", {}) }.to_not raise_error + expect { payload_for("guide", {}) }.to_not raise_error end it "returns empty arrays if there are no related navigation sidebar links" do nothing = payload_for( - "placeholder", + "guide", "details" => { "external_related_links" => [], }, @@ -219,7 +219,7 @@ def payload_for(schema, content_item, context = nil) it "returns an Elsewhere on the web section for external related links" do payload = payload_for( - "placeholder", + "guide", "details" => { "external_related_links" => [ { @@ -262,7 +262,7 @@ def payload_for(schema, content_item, context = nil) it "returns live taxons" do payload = payload_for( - "placeholder", + "guide", "details" => { "external_related_links" => [], }, @@ -308,7 +308,7 @@ def payload_for(schema, content_item, context = nil) end context "for a sidebar" do - subject(:payload) { payload_for("placeholder", {}, :sidebar) } + subject(:payload) { payload_for("guide", {}, :sidebar) } it "only includes collections, guides and related items" do expect(payload).to include( @@ -329,7 +329,7 @@ def payload_for(schema, content_item, context = nil) end context "for a footer" do - subject(:payload) { payload_for("placeholder", {}, :footer) } + subject(:payload) { payload_for("guide", {}, :footer) } it "only includes contacts external links, statistical datasets, topical events, topics and world locations" do expect(payload).to include(