Skip to content

Commit

Permalink
Merge pull request #2152 from alphagov/fix-schedule-publisher
Browse files Browse the repository at this point in the history
Fix scheduled last updated at date
  • Loading branch information
syed-ali-tw authored May 1, 2024
2 parents bdd4144 + a4a4a1f commit 47f0f6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/workers/scheduled_publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def perform(edition_id)
edition = Edition.find(edition_id)
edition.publish_anonymously!

UpdateService.call(edition)
PublishService.call(edition)

report_state_counts
Expand Down
8 changes: 6 additions & 2 deletions test/unit/scheduled_publisher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ class ScheduledPublisherTest < ActiveSupport::TestCase
assert @edition.reload.published?
end

should "call downstream publish service" do
PublishService.expects(:call).with(@edition)
should "update publishing api with latest edition payload before publishing" do
sequence = sequence(:task_order)

UpdateService.expects(:call).with(@edition).in_sequence(sequence)
PublishService.expects(:call).with(@edition).in_sequence(sequence)

ScheduledPublisher.new.perform(@edition.id.to_s)
end

Expand Down

0 comments on commit 47f0f6b

Please sign in to comment.