Skip to content

Commit

Permalink
Order tests alphabetically by method
Browse files Browse the repository at this point in the history
  • Loading branch information
yndajas committed May 31, 2024
1 parent 6423d62 commit bbdc32b
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions test/unit/app/services/bulk_republisher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,6 @@
class BulkRepublisherTest < ActiveSupport::TestCase
extend Minitest::Spec::DSL

describe "#republish_all_published_organisation_about_us_pages" do
test "queues all published organisation 'About us' pages for republishing" do
queue_sequence = sequence("queue")

2.times do
about_us_page = create(:about_corporate_information_page)

PublishingApiDocumentRepublishingWorker
.expects(:perform_async_in_queue)
.with("bulk_republishing", about_us_page.document_id, true)
.in_sequence(queue_sequence)
end

BulkRepublisher.new.republish_all_published_organisation_about_us_pages
end

test "doesn't queue draft organisation 'About us' pages for republishing" do
about_us_page = create(:draft_about_corporate_information_page)

PublishingApiDocumentRepublishingWorker
.expects(:perform_async_in_queue)
.with("bulk_republishing", about_us_page.document_id, true)
.never

BulkRepublisher.new.republish_all_published_organisation_about_us_pages
end
end

describe "#republish_all_documents" do
test "queues all documents for republishing" do
queue_sequence = sequence("queue")
Expand Down Expand Up @@ -201,4 +173,32 @@ class BulkRepublisherTest < ActiveSupport::TestCase
BulkRepublisher.new.republish_all_documents_with_publicly_visible_editions_with_html_attachments
end
end

describe "#republish_all_published_organisation_about_us_pages" do
test "queues all published organisation 'About us' pages for republishing" do
queue_sequence = sequence("queue")

2.times do
about_us_page = create(:about_corporate_information_page)

PublishingApiDocumentRepublishingWorker
.expects(:perform_async_in_queue)
.with("bulk_republishing", about_us_page.document_id, true)
.in_sequence(queue_sequence)
end

BulkRepublisher.new.republish_all_published_organisation_about_us_pages
end

test "doesn't queue draft organisation 'About us' pages for republishing" do
about_us_page = create(:draft_about_corporate_information_page)

PublishingApiDocumentRepublishingWorker
.expects(:perform_async_in_queue)
.with("bulk_republishing", about_us_page.document_id, true)
.never

BulkRepublisher.new.republish_all_published_organisation_about_us_pages
end
end
end

0 comments on commit bbdc32b

Please sign in to comment.