Skip to content

Commit

Permalink
Present editionable topical events summary
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHallam committed Dec 11, 2024
1 parent 35e1c56 commit 1b19989
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions test/factories/editionable_topical_events.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1b19989

Please sign in to comment.