diff --git a/app/presenters/publishing_api/editionable_topical_event_presenter.rb b/app/presenters/publishing_api/editionable_topical_event_presenter.rb index 864980c03cc6..8206eb52ee85 100644 --- a/app/presenters/publishing_api/editionable_topical_event_presenter.rb +++ b/app/presenters/publishing_api/editionable_topical_event_presenter.rb @@ -16,10 +16,12 @@ def initialize(item, update_type: nil, state: "published") def content content = BaseItemPresenter.new( item, + title: item.title, update_type:, ).base_attributes content.merge!( + description: item.summary, details:, document_type: item.class.name.underscore, public_updated_at: item.updated_at, diff --git a/test/factories/editionable_topical_events.rb b/test/factories/editionable_topical_events.rb index dd97c89bb1e0..39aee5df63d0 100644 --- a/test/factories/editionable_topical_events.rb +++ b/test/factories/editionable_topical_events.rb @@ -1,6 +1,7 @@ FactoryBot.define do factory :editionable_topical_event, class: EditionableTopicalEvent, parent: :edition do title { "editionable-topical-event-title" } + summary { "Some basic info about the event" } end factory :draft_editionable_topical_event, parent: :editionable_topical_event, traits: [:draft] diff --git a/test/unit/app/presenters/publishing_api/editionable_topical_event_presenter_test.rb b/test/unit/app/presenters/publishing_api/editionable_topical_event_presenter_test.rb index c9d07ac19a2d..8a9c05bce423 100644 --- a/test/unit/app/presenters/publishing_api/editionable_topical_event_presenter_test.rb +++ b/test/unit/app/presenters/publishing_api/editionable_topical_event_presenter_test.rb @@ -13,6 +13,7 @@ def present(...) expected_hash = { base_path: public_path, title: topical_event.title, + description: topical_event.summary, schema_name: "topical_event", document_type: "editionable_topical_event", locale: "en",