Skip to content

Commit 58ce848

Browse files
committed
Publish history index
This also adds a call to publishing-api which overrides the publishing app's path reservation for the base_path. The reservation is overwritten and updated so the publishing app is government-frontend.
1 parent 49f25b6 commit 58ce848

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/publish_static_pages.rb

+9
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ module PublishStaticPages
3535
template: "histories/lancaster_house",
3636
base_path: "/government/history/lancaster-house",
3737
},
38+
{
39+
content_id: "db95a864-874f-4f50-a483-352a5bc7ba18",
40+
title: "History of the UK government",
41+
description: "In this section you can read short biographies of notable people and explore the history of government buildings. You can also search our online records and read articles and blog posts by historians.",
42+
template: "histories/history",
43+
base_path: "/government/history",
44+
},
3845
].freeze
3946

4047
def self.publish_all
4148
PAGES.each do |page|
4249
payload = present_for_publishing_api(page)
50+
51+
Services.publishing_api.put_path(page[:base_path], publishing_app: "government-frontend", override_existing: true)
4352
Services.publishing_api.put_content(payload[:content_id], payload[:content])
4453
Services.publishing_api.publish(payload[:content_id], nil, locale: "en")
4554
end

test/unit/publish_static_pages_test.rb

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class PublishStaticPagesTest < ActiveSupport::TestCase
1616

1717
def expect_publishing(pages)
1818
pages.each do |page|
19+
Services.publishing_api.expects(:put_path)
20+
.with(page[:base_path], publishing_app: "government-frontend", override_existing: true)
21+
1922
Services.publishing_api.expects(:put_content)
2023
.with(
2124
page[:content_id],

0 commit comments

Comments
 (0)