Skip to content

Commit 08a88ed

Browse files
committed
Remove code relating to indexing topical event about pages in Search API
These pages were not being indexed by Whitehall because the `can_index_in_search?` method was evaluating to false. This was due to topical event about pages being absent from the search API presenter's allowlist. Given nobody seems to have missed them, it seems reasonable to maintain the status quo. We may choose to start indexing them via Publishing API in future, but we don't want to reintroduce the behaviour to Whitehall.
1 parent 5be83a6 commit 08a88ed

3 files changed

Lines changed: 2 additions & 23 deletions

File tree

app/models/topical_event_about_page.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class TopicalEventAboutPage < ApplicationRecord
2-
include Searchable
32
include PublishesToPublishingApi
43

54
belongs_to :topical_event
@@ -14,19 +13,6 @@ class TopicalEventAboutPage < ApplicationRecord
1413

1514
after_commit :republish_topical_event_to_publishing_api
1615

17-
searchable title: :name,
18-
link: :search_link,
19-
content: :indexable_content,
20-
description: :summary
21-
22-
def search_link
23-
base_path
24-
end
25-
26-
def indexable_content
27-
Govspeak::Document.new(body).to_text
28-
end
29-
3016
def base_path
3117
"/government/topical-events/#{topical_event.slug}/about"
3218
end

test/unit/app/models/topical_event_about_page_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
require "test_helper"
22

33
class TopicalEventAboutPageTest < ActiveSupport::TestCase
4-
test "should return search index data suitable for Searchable" do
5-
event = create(:topical_event)
6-
page = create(:topical_event_about_page, topical_event: event)
7-
assert_equal page.name, page.search_index["title"]
8-
assert_equal "/government/topical-events/#{event.slug}/about", page.search_index["link"]
9-
end
10-
114
test "public_path returns the correct path" do
125
object = create(:topical_event, slug: "foo", topical_event_about_page: create(:topical_event_about_page))
136
assert_equal "/government/topical-events/foo/about", object.topical_event_about_page.public_path

test/unit/app/presenters/publishing_api/topical_event_about_page_presenter_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def present(record)
99
topical_event_about_page = create(:topical_event_about_page)
1010

1111
expected_hash = {
12-
base_path: topical_event_about_page.search_link,
12+
base_path: topical_event_about_page.base_path,
1313
title: topical_event_about_page.name,
1414
description: "Summary",
1515
schema_name: "topical_event_about_page",
@@ -19,7 +19,7 @@ def present(record)
1919
publishing_app: Whitehall::PublishingApp::WHITEHALL,
2020
rendering_app: "frontend",
2121
routes: [
22-
{ path: topical_event_about_page.search_link, type: "exact" },
22+
{ path: topical_event_about_page.base_path, type: "exact" },
2323
],
2424
redirects: [],
2525
update_type: "major",

0 commit comments

Comments
 (0)