diff --git a/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb b/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb index ceb710c77e3..b4debdf542b 100644 --- a/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb +++ b/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb @@ -8,7 +8,7 @@ def initialize(caption:, host_content_items:, content_block_edition:, is_preview @host_content_items = host_content_items @is_preview = is_preview @current_page = current_page.presence || 1 - @order = order.presence || ContentBlockManager::GetHostContentItems::DEFAULT_ORDER + @order = order.presence || ContentBlockManager::HostContentItem::DEFAULT_ORDER @content_block_edition = content_block_edition end diff --git a/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/documents_controller.rb b/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/documents_controller.rb index 7b5a01cff69..1df812727a2 100644 --- a/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/documents_controller.rb +++ b/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/documents_controller.rb @@ -23,8 +23,8 @@ def show @order = params[:order] @page = params[:page] - @host_content_items = ContentBlockManager::GetHostContentItems.by_embedded_document( - content_block_document: @content_block_document, + @host_content_items = ContentBlockManager::HostContentItem.for_document( + @content_block_document, order: @order, page: @page, ) diff --git a/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb b/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb index 1b282ffdd3f..7f95c3c411f 100644 --- a/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb +++ b/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb @@ -109,8 +109,8 @@ def review_links @order = params[:order] @page = params[:page] - @host_content_items = ContentBlockManager::GetHostContentItems.by_embedded_document( - content_block_document: @content_block_document, + @host_content_items = ContentBlockManager::HostContentItem.for_document( + @content_block_document, order: @order, page: @page, ) diff --git a/lib/engines/content_block_manager/app/services/content_block_manager/get_host_content_items.rb b/lib/engines/content_block_manager/app/services/content_block_manager/get_host_content_items.rb deleted file mode 100644 index 8fc9df6468e..00000000000 --- a/lib/engines/content_block_manager/app/services/content_block_manager/get_host_content_items.rb +++ /dev/null @@ -1,77 +0,0 @@ -require "net/http" -require "json" -require "uri" - -module ContentBlockManager - class GetHostContentItems - attr_reader :content_id, :page, :order - - DEFAULT_ORDER = "-unique_pageviews".freeze - - def initialize(content_id:, page: nil, order: nil) - self.content_id = content_id - self.page = page - self.order = order || DEFAULT_ORDER - end - - def self.by_embedded_document(content_block_document:, page: nil, order: nil) - new(content_id: content_block_document.content_id, page:, order:).items - end - - def items - items = content_items["results"].map do |item| - ContentBlockManager::HostContentItem.new( - title: item["title"], - base_path: item["base_path"], - document_type: item["document_type"], - publishing_organisation: item["primary_publishing_organisation"], - publishing_app: item["publishing_app"], - last_edited_by_editor: editor_for_uid(item["last_edited_by_editor_id"]), - last_edited_at: item["last_edited_at"], - unique_pageviews: item["unique_pageviews"], - instances: item["instances"], - host_content_id: item["host_content_id"], - ) - end - - ContentBlockManager::HostContentItems.new( - items:, - total: content_items["total"], - total_pages: content_items["total_pages"], - rollup:, - ) - end - - def rollup - ContentBlockManager::HostContentItems::Rollup.new( - views: content_items["rollup"]["views"], - locations: content_items["rollup"]["locations"], - instances: content_items["rollup"]["instances"], - organisations: content_items["rollup"]["organisations"], - ) - end - - private - - attr_writer :content_id, :page, :order - - def content_items - @content_items ||= begin - response = Services.publishing_api.get_host_content_for_content_id(@content_id, { page:, order: }.compact) - response.parsed_content - end - end - - def editor_for_uid(uid) - editors.find { |editor| editor.uid == uid } - end - - def editors - @editors ||= editor_uuids.present? ? ContentBlockManager::HostContentItem::Editor.with_uuids(editor_uuids) : [] - end - - def editor_uuids - content_items["results"].map { |c| c["last_edited_by_editor_id"] }.compact - end - end -end diff --git a/lib/engines/content_block_manager/app/services/content_block_manager/schedule_edition_service.rb b/lib/engines/content_block_manager/app/services/content_block_manager/schedule_edition_service.rb index 83674ffd5be..2bd8ec08c8a 100644 --- a/lib/engines/content_block_manager/app/services/content_block_manager/schedule_edition_service.rb +++ b/lib/engines/content_block_manager/app/services/content_block_manager/schedule_edition_service.rb @@ -33,9 +33,7 @@ def schedule_with_rollback end def send_publish_intents_for_host_documents(content_block_edition:) - host_content_items = ContentBlockManager::GetHostContentItems.by_embedded_document( - content_block_document: content_block_edition.document, - ) + host_content_items = ContentBlockManager::HostContentItem.for_document(content_block_edition.document) host_content_items.each do |host_content_item| ContentBlockManager::PublishIntentWorker.perform_async( host_content_item.base_path, diff --git a/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb b/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb index a493bed5e91..0d75778309e 100644 --- a/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb +++ b/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb @@ -536,7 +536,7 @@ def should_show_edit_form_for_email_address_content_block(document_title, email_ stub_publishing_api_has_embedded_content_for_any_content_id( results: @dependent_content, total: @dependent_content.length, - order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER, + order: ContentBlockManager::HostContentItem::DEFAULT_ORDER, rollup: @rollup, ) diff --git a/lib/engines/content_block_manager/features/support/stubs.rb b/lib/engines/content_block_manager/features/support/stubs.rb index afeec020711..c7f924e1326 100644 --- a/lib/engines/content_block_manager/features/support/stubs.rb +++ b/lib/engines/content_block_manager/features/support/stubs.rb @@ -1,5 +1,5 @@ Before do - stub_publishing_api_has_embedded_content_for_any_content_id(total: 0, results: [], order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER) + stub_publishing_api_has_embedded_content_for_any_content_id(total: 0, results: [], order: ContentBlockManager::HostContentItem::DEFAULT_ORDER) end Before("@disable_sidekiq") do diff --git a/lib/engines/content_block_manager/test/factories/host_content_items.rb b/lib/engines/content_block_manager/test/factories/host_content_items.rb index ecef943063b..d5900b584aa 100644 --- a/lib/engines/content_block_manager/test/factories/host_content_items.rb +++ b/lib/engines/content_block_manager/test/factories/host_content_items.rb @@ -1,5 +1,5 @@ FactoryBot.define do - factory :host_content_items, class: "ContentBlockManager::HostContentItems" do + factory :host_content_items, class: "ContentBlockManager::HostContentItem::Items" do total_pages { 1 } total { 10 } items { build_list(:host_content_item, 10) } @@ -13,7 +13,7 @@ end end - factory :rollup, class: "ContentBlockManager::HostContentItems::Rollup" do + factory :rollup, class: "ContentBlockManager::HostContentItem::Items::Rollup" do views { Random.rand(0..10) } locations { Random.rand(0..10) } instances { Random.rand(0..10) } diff --git a/lib/engines/content_block_manager/test/integration/content_block/documents_test.rb b/lib/engines/content_block_manager/test/integration/content_block/documents_test.rb index 3453ba26dec..2ee09241f38 100644 --- a/lib/engines/content_block_manager/test/integration/content_block/documents_test.rb +++ b/lib/engines/content_block_manager/test/integration/content_block/documents_test.rb @@ -136,7 +136,7 @@ class ContentBlockManager::ContentBlock::DocumentsTest < ActionDispatch::Integra stub_publishing_api_has_embedded_content_for_any_content_id( results: [], total: 0, - order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER, + order: ContentBlockManager::HostContentItem::DEFAULT_ORDER, ) visit content_block_manager_content_block_document_path(document) diff --git a/lib/engines/content_block_manager/test/integration/content_block/workflow_test.rb b/lib/engines/content_block_manager/test/integration/content_block/workflow_test.rb index d0a2e5af45c..52608be2d9b 100644 --- a/lib/engines/content_block_manager/test/integration/content_block/workflow_test.rb +++ b/lib/engines/content_block_manager/test/integration/content_block/workflow_test.rb @@ -25,7 +25,7 @@ class ContentBlockManager::ContentBlock::WorkflowTest < ActionDispatch::Integrat stub_request_for_schema("email_address") - stub_publishing_api_has_embedded_content(content_id: @content_id, total: 0, results: [], order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER) + stub_publishing_api_has_embedded_content(content_id: @content_id, total: 0, results: [], order: ContentBlockManager::HostContentItem::DEFAULT_ORDER) end describe "when creating a new content block" do diff --git a/lib/engines/content_block_manager/test/support/embedded_content_helpers.rb b/lib/engines/content_block_manager/test/support/embedded_content_helpers.rb index 64fc3fdc9cf..65a6ee92ce6 100644 --- a/lib/engines/content_block_manager/test/support/embedded_content_helpers.rb +++ b/lib/engines/content_block_manager/test/support/embedded_content_helpers.rb @@ -25,7 +25,7 @@ def self.it_returns_embedded_content(&block) stub_publishing_api_has_embedded_content_for_any_content_id( results: host_content_items, total: host_content_items.length, - order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER, + order: ContentBlockManager::HostContentItem::DEFAULT_ORDER, ) ContentBlockManager::HostContentItem::Editor.stubs(:with_uuids).with(host_content_items.map { |i| i["last_edited_by_editor_id"] }).returns(host_content_item_users) @@ -51,7 +51,7 @@ def self.it_returns_embedded_content(&block) results: host_content_items, total:, total_pages: 4, - order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER, + order: ContentBlockManager::HostContentItem::DEFAULT_ORDER, ) pages.each.with_index(2) do |page, i| @@ -59,7 +59,7 @@ def self.it_returns_embedded_content(&block) results: page, total:, total_pages: 4, - order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER, + order: ContentBlockManager::HostContentItem::DEFAULT_ORDER, page_number: i.to_s, ) end diff --git a/lib/engines/content_block_manager/test/unit/app/models/host_content_item_test.rb b/lib/engines/content_block_manager/test/unit/app/models/host_content_item_test.rb index ec99ba70220..19224d466b5 100644 --- a/lib/engines/content_block_manager/test/unit/app/models/host_content_item_test.rb +++ b/lib/engines/content_block_manager/test/unit/app/models/host_content_item_test.rb @@ -3,6 +3,151 @@ class ContentBlockManager::HostContentItemTest < ActiveSupport::TestCase extend Minitest::Spec::DSL + describe ".for_document" do + let(:described_class) { ContentBlockManager::HostContentItem } + + let(:target_content_id) { SecureRandom.uuid } + + let(:host_content_id) { SecureRandom.uuid } + + let(:last_edited_by_editor_id) { SecureRandom.uuid } + + let(:rollup) { build(:rollup) } + + let(:response_body) do + { + "content_id" => SecureRandom.uuid, + "total" => 111, + "total_pages" => 12, + "rollup" => rollup.to_h, + "results" => [ + { + "title" => "foo", + "base_path" => "/foo", + "document_type" => "something", + "publishing_app" => "publisher", + "last_edited_by_editor_id" => last_edited_by_editor_id, + "last_edited_at" => "2023-01-01T08:00:00.000Z", + "unique_pageviews" => 123, + "instances" => 1, + "host_content_id" => host_content_id, + "primary_publishing_organisation" => { + "content_id" => SecureRandom.uuid, + "title" => "bar", + "base_path" => "/bar", + }, + }, + ], + } + end + + let(:editor) { build(:host_content_item_editor, uid: last_edited_by_editor_id) } + + let(:fake_api_response) do + GdsApi::Response.new( + stub("http_response", code: 200, body: response_body.to_json), + ) + end + let(:publishing_api_mock) { stub("GdsApi::PublishingApi") } + let(:document) { mock("content_block_document", content_id: target_content_id) } + + before do + Services.expects(:publishing_api).returns(publishing_api_mock) + ContentBlockManager::HostContentItem::Editor.stubs(:with_uuids).returns([editor]) + end + + it "calls the Publishing API for the content which embeds the target" do + publishing_api_mock.expects(:get_host_content_for_content_id) + .with(target_content_id, { order: described_class::DEFAULT_ORDER }) + .returns(fake_api_response) + + described_class.for_document(document) + end + + it "supports pagination" do + publishing_api_mock.expects(:get_host_content_for_content_id) + .with(target_content_id, { page: 1, order: described_class::DEFAULT_ORDER }) + .returns(fake_api_response) + + described_class.for_document(document, page: 1) + end + + it "supports sorting" do + publishing_api_mock.expects(:get_host_content_for_content_id) + .with(target_content_id, { order: "-abc" }) + .returns(fake_api_response) + + described_class.for_document(document, order: "-abc") + end + + it "calls the editor finder with the correct argument" do + publishing_api_mock.expects(:get_host_content_for_content_id).returns(fake_api_response) + ContentBlockManager::HostContentItem::Editor.expects(:with_uuids).with([last_edited_by_editor_id]).returns([editor]) + + described_class.for_document(document) + end + + it "returns items" do + publishing_api_mock.expects(:get_host_content_for_content_id).returns(fake_api_response) + + result = described_class.for_document(document) + + expected_publishing_organisation = { + "content_id" => response_body["results"][0]["primary_publishing_organisation"]["content_id"], + "title" => response_body["results"][0]["primary_publishing_organisation"]["title"], + "base_path" => response_body["results"][0]["primary_publishing_organisation"]["base_path"], + } + + assert_equal result.total, response_body["total"] + assert_equal result.total_pages, response_body["total_pages"] + + assert_equal result.rollup.views, rollup.views + assert_equal result.rollup.locations, rollup.locations + assert_equal result.rollup.instances, rollup.instances + assert_equal result.rollup.organisations, rollup.organisations + + assert_equal result[0].title, response_body["results"][0]["title"] + assert_equal result[0].base_path, response_body["results"][0]["base_path"] + assert_equal result[0].document_type, response_body["results"][0]["document_type"] + assert_equal result[0].publishing_app, response_body["results"][0]["publishing_app"] + assert_equal result[0].last_edited_by_editor, editor + assert_equal result[0].last_edited_at, Time.zone.parse(response_body["results"][0]["last_edited_at"]) + assert_equal result[0].unique_pageviews, response_body["results"][0]["unique_pageviews"] + assert_equal result[0].instances, response_body["results"][0]["instances"] + assert_equal result[0].host_content_id, response_body["results"][0]["host_content_id"] + + assert_equal result[0].publishing_organisation, expected_publishing_organisation + end + + describe "when last_edited_by_editor_id is nil" do + let(:last_edited_by_editor_id) { nil } + + it "returns nil for last_edited_by_editor" do + publishing_api_mock.expects(:get_host_content_for_content_id).returns(fake_api_response) + + ContentBlockManager::HostContentItem::Editor.expects(:with_uuids).never + + result = described_class.for_document(document) + + assert_equal result[0].last_edited_by_editor, nil + end + end + + it "returns an error if the content that embeds the target can't be loaded" do + publishing_api_mock.expects(:get_host_content_for_content_id).raises( + GdsApi::HTTPErrorResponse.new( + 500, + "An internal error message", + "error" => { "message" => "Some backend error" }, + ), + ) + + assert_raises(GdsApi::HTTPErrorResponse) do + described_class.for_document(document) + end + end + end + describe "#last_edited_at" do it "translates to a TimeWithZone object" do last_edited_at = 4.days.ago diff --git a/lib/engines/content_block_manager/test/unit/app/models/host_content_items_test.rb b/lib/engines/content_block_manager/test/unit/app/models/host_content_items_test.rb deleted file mode 100644 index 6c158a1b2aa..00000000000 --- a/lib/engines/content_block_manager/test/unit/app/models/host_content_items_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "test_helper" - -class ContentBlockManager::HostContentItemsTest < ActiveSupport::TestCase - extend Minitest::Spec::DSL - - let(:items) { build_list(:host_content_item, 5) } - let(:total) { 12 } - let(:total_pages) { 2 } - let(:rollup) { build(:rollup) } - let(:host_content_items) { build(:host_content_items, items:, total:, total_pages:, rollup:) } - - it "delegates array methods to items" do - ([].methods - Object.methods).each do |method| - assert host_content_items.respond_to?(method) - end - - host_content_items.each_with_index do |item, i| - assert_equal item, items[i] - end - end - - it "returns page count values" do - assert_equal host_content_items.total, total - assert_equal host_content_items.total_pages, total_pages - end -end diff --git a/lib/engines/content_block_manager/test/unit/app/services/get_host_content_items_test.rb b/lib/engines/content_block_manager/test/unit/app/services/get_host_content_items_test.rb deleted file mode 100644 index 200327433ca..00000000000 --- a/lib/engines/content_block_manager/test/unit/app/services/get_host_content_items_test.rb +++ /dev/null @@ -1,162 +0,0 @@ -require "test_helper" - -class ContentBlockManager::GetHostContentItemsTest < ActiveSupport::TestCase - extend Minitest::Spec::DSL - - let(:described_class) { ContentBlockManager::GetHostContentItems } - - let(:target_content_id) { SecureRandom.uuid } - - let(:host_content_id) { SecureRandom.uuid } - - let(:last_edited_by_editor_id) { SecureRandom.uuid } - - let(:rollup) { build(:rollup) } - - let(:response_body) do - { - "content_id" => SecureRandom.uuid, - "total" => 111, - "total_pages" => 12, - "rollup" => rollup.to_h, - "results" => [ - { - "title" => "foo", - "base_path" => "/foo", - "document_type" => "something", - "publishing_app" => "publisher", - "last_edited_by_editor_id" => last_edited_by_editor_id, - "last_edited_at" => "2023-01-01T08:00:00.000Z", - "unique_pageviews" => 123, - "instances" => 1, - "host_content_id" => host_content_id, - "primary_publishing_organisation" => { - "content_id" => SecureRandom.uuid, - "title" => "bar", - "base_path" => "/bar", - }, - }, - ], - } - end - - let(:editor) { build(:host_content_item_editor, uid: last_edited_by_editor_id) } - - setup do - stub_publishing_api_has_embedded_content(content_id: target_content_id, total: 111, total_pages: 12, results: response_body["results"], order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER, rollup: response_body["rollup"]) - end - - describe "#items" do - let(:fake_api_response) do - GdsApi::Response.new( - stub("http_response", code: 200, body: response_body.to_json), - ) - end - let(:publishing_api_mock) { stub("GdsApi::PublishingApi") } - let(:document) { mock("content_block_document", content_id: target_content_id) } - - before do - Services.expects(:publishing_api).returns(publishing_api_mock) - ContentBlockManager::HostContentItem::Editor.stubs(:with_uuids).returns([editor]) - end - - it "calls the Publishing API for the content which embeds the target" do - publishing_api_mock.expects(:get_host_content_for_content_id) - .with(target_content_id, { order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER }) - .returns(fake_api_response) - - described_class.by_embedded_document(content_block_document: document) - end - - it "supports pagination" do - publishing_api_mock.expects(:get_host_content_for_content_id) - .with(target_content_id, { page: 1, order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER }) - .returns(fake_api_response) - - described_class.by_embedded_document( - content_block_document: document, - page: 1, - ) - end - - it "supports sorting" do - publishing_api_mock.expects(:get_host_content_for_content_id) - .with(target_content_id, { order: "-abc" }) - .returns(fake_api_response) - - described_class.by_embedded_document( - content_block_document: document, - order: "-abc", - ) - end - - it "calls the editor finder with the correct argument" do - publishing_api_mock.expects(:get_host_content_for_content_id).returns(fake_api_response) - ContentBlockManager::HostContentItem::Editor.expects(:with_uuids).with([last_edited_by_editor_id]).returns([editor]) - - described_class.by_embedded_document(content_block_document: document) - end - - it "returns GetHostContentItems" do - publishing_api_mock.expects(:get_host_content_for_content_id).returns(fake_api_response) - - result = described_class.by_embedded_document(content_block_document: document) - - expected_publishing_organisation = { - "content_id" => response_body["results"][0]["primary_publishing_organisation"]["content_id"], - "title" => response_body["results"][0]["primary_publishing_organisation"]["title"], - "base_path" => response_body["results"][0]["primary_publishing_organisation"]["base_path"], - } - - assert_equal result.total, response_body["total"] - assert_equal result.total_pages, response_body["total_pages"] - - assert_equal result.rollup.views, rollup.views - assert_equal result.rollup.locations, rollup.locations - assert_equal result.rollup.instances, rollup.instances - assert_equal result.rollup.organisations, rollup.organisations - - assert_equal result[0].title, response_body["results"][0]["title"] - assert_equal result[0].base_path, response_body["results"][0]["base_path"] - assert_equal result[0].document_type, response_body["results"][0]["document_type"] - assert_equal result[0].publishing_app, response_body["results"][0]["publishing_app"] - assert_equal result[0].last_edited_by_editor, editor - assert_equal result[0].last_edited_at, Time.zone.parse(response_body["results"][0]["last_edited_at"]) - assert_equal result[0].unique_pageviews, response_body["results"][0]["unique_pageviews"] - assert_equal result[0].instances, response_body["results"][0]["instances"] - assert_equal result[0].host_content_id, response_body["results"][0]["host_content_id"] - - assert_equal result[0].publishing_organisation, expected_publishing_organisation - end - - describe "when last_edited_by_editor_id is nil" do - let(:last_edited_by_editor_id) { nil } - - it "does not call #with_uuids" do - publishing_api_mock.expects(:get_host_content_for_content_id).returns(fake_api_response) - - ContentBlockManager::HostContentItem::Editor.expects(:with_uuids).never - - result = described_class.by_embedded_document(content_block_document: document) - - assert_equal result[0].last_edited_by_editor, nil - end - end - - it "returns an error if the content that embeds the target can't be loaded" do - publishing_api_mock.expects(:get_host_content_for_content_id).raises( - GdsApi::HTTPErrorResponse.new( - 500, - "An internal error message", - "error" => { "message" => "Some backend error" }, - ), - ) - - assert_raises(GdsApi::HTTPErrorResponse) do - described_class.by_embedded_document( - content_block_document: document, - ) - end - end - end -end diff --git a/lib/engines/content_block_manager/test/unit/app/services/schedule_edition_service_test.rb b/lib/engines/content_block_manager/test/unit/app/services/schedule_edition_service_test.rb index 1eb6f4b5414..de80bb53ca6 100644 --- a/lib/engines/content_block_manager/test/unit/app/services/schedule_edition_service_test.rb +++ b/lib/engines/content_block_manager/test/unit/app/services/schedule_edition_service_test.rb @@ -17,7 +17,7 @@ class ContentBlockManager::ScheduleEditionServiceTest < ActiveSupport::TestCase setup do ContentBlockManager::ContentBlock::Schema.stubs(:find_by_block_type) .returns(schema) - stub_publishing_api_has_embedded_content(content_id:, total: 0, results: [], order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER) + stub_publishing_api_has_embedded_content(content_id:, total: 0, results: [], order: ContentBlockManager::HostContentItem::DEFAULT_ORDER) end describe "#call" do @@ -141,7 +141,7 @@ class ContentBlockManager::ScheduleEditionServiceTest < ActiveSupport::TestCase }, ] - stub_publishing_api_has_embedded_content(content_id:, total: 0, results: dependent_content, order: ContentBlockManager::GetHostContentItems::DEFAULT_ORDER) + stub_publishing_api_has_embedded_content(content_id:, total: 0, results: dependent_content, order: ContentBlockManager::HostContentItem::DEFAULT_ORDER) ContentBlockManager::PublishIntentWorker.expects(:perform_async).with( "/host-document",