diff --git a/Rakefile b/Rakefile index b8017070a..2b5f15535 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,7 @@ require File.expand_path("../config/application", __FILE__) -SpecialistPublisher::Application.load_tasks +ManualsPublisher::Application.load_tasks task :rubocop do system("bin/rubocop") diff --git a/app/controllers/abstract_documents_controller.rb b/app/controllers/abstract_documents_controller.rb index 75a811176..1b2e1b39b 100644 --- a/app/controllers/abstract_documents_controller.rb +++ b/app/controllers/abstract_documents_controller.rb @@ -1,4 +1,4 @@ -require "specialist_publisher" +require "manuals_publisher" class AbstractDocumentsController < ApplicationController before_filter :authorize_user_for_editing @@ -181,11 +181,11 @@ def document_params end def view_adapter(document) - SpecialistPublisher.view_adapter(document) + ManualsPublisher.view_adapter(document) end def services - SpecialistPublisher.document_services(document_type) + ManualsPublisher.document_services(document_type) end def index_path diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 514b82381..eb14a4bd6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,4 @@ -require "specialist_publisher_wiring" +require "manuals_publisher_wiring" require "forwardable" require "permission_checker" require "url_maker" diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index f2ea31010..77771921e 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -39,11 +39,11 @@ def update private def view_adapter(document) - SpecialistPublisher.view_adapter(document) + ManualsPublisher.view_adapter(document) end def services - SpecialistPublisher.attachment_services(document_type) + ManualsPublisher.attachment_services(document_type) end def edit_path(document) diff --git a/app/importers/cma_import.rb b/app/importers/cma_import.rb index 1bfb07020..9b8d4d694 100644 --- a/app/importers/cma_import.rb +++ b/app/importers/cma_import.rb @@ -92,7 +92,7 @@ def cma_case_factory end def cma_cases_repository - SpecialistPublisherWiring.get(:repository_registry).for_type("cma_case") + ManualsPublisherWiring.get(:repository_registry).for_type("cma_case") end def logger diff --git a/app/importers/medical_safety_alert_import.rb b/app/importers/medical_safety_alert_import.rb index 8b8c09b4b..f996b9330 100644 --- a/app/importers/medical_safety_alert_import.rb +++ b/app/importers/medical_safety_alert_import.rb @@ -69,7 +69,7 @@ def report_builder SpecialistDocumentBuilder.new("medical_safety_alert", ->(*args) { null_validator( - SpecialistPublisherWiring + ManualsPublisherWiring .get(:validatable_document_factories) .medical_safety_alert_factory .call(*args) @@ -79,7 +79,7 @@ def report_builder end def repo - SpecialistPublisherWiring.get(:repository_registry).for_type("medical_safety_alert") + ManualsPublisherWiring.get(:repository_registry).for_type("medical_safety_alert") end def null_validator(thing) diff --git a/app/lib/finder_schema.rb b/app/lib/finder_schema.rb index c701e9fd6..fbae8153d 100644 --- a/app/lib/finder_schema.rb +++ b/app/lib/finder_schema.rb @@ -3,13 +3,13 @@ class FinderSchema def self.humanized_facet_name(key, entity, type) - schema = SpecialistPublisherWiring.get("#{type}_finder_schema".to_sym) + schema = ManualsPublisherWiring.get("#{type}_finder_schema".to_sym) value = entity.send(key) schema.humanized_facet_value(key, value) end def self.options_for(facet_name, type) - schema = SpecialistPublisherWiring.get("#{type}_finder_schema".to_sym) + schema = ManualsPublisherWiring.get("#{type}_finder_schema".to_sym) schema.options_for(facet_name) end diff --git a/app/lib/specialist_publisher.rb b/app/lib/manuals_publisher.rb similarity index 94% rename from app/lib/specialist_publisher.rb rename to app/lib/manuals_publisher.rb index 20fa6443c..b6eab69e4 100644 --- a/app/lib/specialist_publisher.rb +++ b/app/lib/manuals_publisher.rb @@ -1,4 +1,4 @@ -module SpecialistPublisher +module ManualsPublisher extend self def attachment_services(document_type) @@ -10,7 +10,7 @@ def attachment_services(document_type) def document_services(document_type) AbstractDocumentServiceRegistry.new( repository: document_repositories.for_type(document_type), - builder: SpecialistPublisherWiring.get("#{document_type}_builder".to_sym), + builder: ManualsPublisherWiring.get("#{document_type}_builder".to_sym), observers: observer_registry(document_type), ) end @@ -91,11 +91,11 @@ def document_types } def view_adapters - SpecialistPublisherWiring.get(:view_adapter_registry) + ManualsPublisherWiring.get(:view_adapter_registry) end def document_repositories - SpecialistPublisherWiring.get(:repository_registry) + ManualsPublisherWiring.get(:repository_registry) end def observer_registry(document_type) diff --git a/app/lib/specialist_publisher_wiring.rb b/app/lib/manuals_publisher_wiring.rb similarity index 99% rename from app/lib/specialist_publisher_wiring.rb rename to app/lib/manuals_publisher_wiring.rb index 4be531764..94a461153 100644 --- a/app/lib/specialist_publisher_wiring.rb +++ b/app/lib/manuals_publisher_wiring.rb @@ -22,7 +22,7 @@ $LOAD_PATH.unshift(File.expand_path("../..", "app/services")) # rubocop:disable ConstantName -SpecialistPublisherWiring ||= DependencyContainer.new do +ManualsPublisherWiring ||= DependencyContainer.new do define_factory(:manual_builder) { ManualBuilder.new( slug_generator: SlugGenerator.new(prefix: "guidance"), diff --git a/app/observers/abstract_specialist_document_observers_registry.rb b/app/observers/abstract_specialist_document_observers_registry.rb index 71a9daacf..8d735ea61 100644 --- a/app/observers/abstract_specialist_document_observers_registry.rb +++ b/app/observers/abstract_specialist_document_observers_registry.rb @@ -63,7 +63,7 @@ def publishing_api_exporter(force_draft = false) ->(document, update_type = nil) { rendered_document = SpecialistDocumentPublishingAPIFormatter.new( document, - specialist_document_renderer: SpecialistPublisherWiring.get(:specialist_document_renderer), + specialist_document_renderer: ManualsPublisherWiring.get(:specialist_document_renderer), publication_logs: PublicationLog, links: format_links_for_publishing_api(document), update_type: update_type @@ -119,7 +119,7 @@ def format_links_for_publishing_api(document) end def email_alert_api - SpecialistPublisherWiring.get(:email_alert_api) + ManualsPublisherWiring.get(:email_alert_api) end def publication_alert_exporter @@ -155,10 +155,10 @@ def url_maker end def publishing_api - SpecialistPublisherWiring.get(:publishing_api) + ManualsPublisherWiring.get(:publishing_api) end def publishing_api_v2 - SpecialistPublisherWiring.get(:publishing_api_v2) + ManualsPublisherWiring.get(:publishing_api_v2) end end diff --git a/app/observers/asylum_support_decision_observers_registry.rb b/app/observers/asylum_support_decision_observers_registry.rb index b7565e01e..cc2275f5f 100644 --- a/app/observers/asylum_support_decision_observers_registry.rb +++ b/app/observers/asylum_support_decision_observers_registry.rb @@ -6,7 +6,7 @@ class AsylumSupportDecisionObserversRegistry < AbstractSpecialistDocumentObserve private def finder_schema - SpecialistPublisherWiring.get(:asylum_support_decision_finder_schema) + ManualsPublisherWiring.get(:asylum_support_decision_finder_schema) end def format_document_for_indexing(document) diff --git a/app/observers/employment_appeal_tribunal_decision_observers_registry.rb b/app/observers/employment_appeal_tribunal_decision_observers_registry.rb index 8de2a5a68..4ed1b9360 100644 --- a/app/observers/employment_appeal_tribunal_decision_observers_registry.rb +++ b/app/observers/employment_appeal_tribunal_decision_observers_registry.rb @@ -6,7 +6,7 @@ class EmploymentAppealTribunalDecisionObserversRegistry < AbstractSpecialistDocu private def finder_schema - SpecialistPublisherWiring.get(:employment_appeal_tribunal_decision_finder_schema) + ManualsPublisherWiring.get(:employment_appeal_tribunal_decision_finder_schema) end def format_document_for_indexing(document) diff --git a/app/observers/employment_tribunal_decision_observers_registry.rb b/app/observers/employment_tribunal_decision_observers_registry.rb index 7d65a26bf..a6bd486ea 100644 --- a/app/observers/employment_tribunal_decision_observers_registry.rb +++ b/app/observers/employment_tribunal_decision_observers_registry.rb @@ -6,7 +6,7 @@ class EmploymentTribunalDecisionObserversRegistry < AbstractSpecialistDocumentOb private def finder_schema - SpecialistPublisherWiring.get(:employment_tribunal_decision_finder_schema) + ManualsPublisherWiring.get(:employment_tribunal_decision_finder_schema) end def format_document_for_indexing(document) diff --git a/app/observers/manual_observers_registry.rb b/app/observers/manual_observers_registry.rb index 3ce857841..96f3d55bf 100644 --- a/app/observers/manual_observers_registry.rb +++ b/app/observers/manual_observers_registry.rb @@ -98,7 +98,7 @@ def rummager_withdrawer def publishing_api_exporter ->(manual, action = nil) { - manual_renderer = SpecialistPublisherWiring.get(:manual_renderer) + manual_renderer = ManualsPublisherWiring.get(:manual_renderer) ManualPublishingAPIExporter.new( publishing_api.method(:put_content_item), organisation(manual.attributes.fetch(:organisation_slug)), @@ -107,7 +107,7 @@ def publishing_api_exporter manual ).call - document_renderer = SpecialistPublisherWiring.get(:manual_document_renderer) + document_renderer = ManualsPublisherWiring.get(:manual_document_renderer) manual.documents.each do |document| next if !document.needs_exporting? && action != :republish @@ -126,7 +126,7 @@ def publishing_api_exporter def publishing_api_draft_exporter ->(manual, _ = nil) { - manual_renderer = SpecialistPublisherWiring.get(:manual_renderer) + manual_renderer = ManualsPublisherWiring.get(:manual_renderer) ManualPublishingAPIExporter.new( publishing_api.method(:put_draft_content_item), organisation(manual.attributes.fetch(:organisation_slug)), @@ -154,10 +154,10 @@ def publishing_api_withdrawer end def publishing_api - SpecialistPublisherWiring.get(:publishing_api) + ManualsPublisherWiring.get(:publishing_api) end def organisation(slug) - SpecialistPublisherWiring.get(:organisation_fetcher).call(slug) + ManualsPublisherWiring.get(:organisation_fetcher).call(slug) end end diff --git a/app/observers/tax_tribunal_decision_observers_registry.rb b/app/observers/tax_tribunal_decision_observers_registry.rb index 9e991edb1..64c821f0d 100644 --- a/app/observers/tax_tribunal_decision_observers_registry.rb +++ b/app/observers/tax_tribunal_decision_observers_registry.rb @@ -6,7 +6,7 @@ class TaxTribunalDecisionObserversRegistry < AbstractSpecialistDocumentObservers private def finder_schema - SpecialistPublisherWiring.get(:tax_tribunal_decision_finder_schema) + ManualsPublisherWiring.get(:tax_tribunal_decision_finder_schema) end def format_document_for_indexing(document) diff --git a/app/observers/utaac_decision_observers_registry.rb b/app/observers/utaac_decision_observers_registry.rb index bf7183004..ebe277ac3 100644 --- a/app/observers/utaac_decision_observers_registry.rb +++ b/app/observers/utaac_decision_observers_registry.rb @@ -6,7 +6,7 @@ class UtaacDecisionObserversRegistry < AbstractSpecialistDocumentObserversRegist private def finder_schema - SpecialistPublisherWiring.get(:utaac_decision_finder_schema) + ManualsPublisherWiring.get(:utaac_decision_finder_schema) end def format_document_for_indexing(document) diff --git a/app/services/abstract_document_service_registry.rb b/app/services/abstract_document_service_registry.rb index 5f0c176c9..bc01bb6e8 100644 --- a/app/services/abstract_document_service_registry.rb +++ b/app/services/abstract_document_service_registry.rb @@ -1,4 +1,4 @@ -require "specialist_publisher_wiring" +require "manuals_publisher_wiring" require "list_documents_service" require "show_document_service" require "new_document_service" @@ -113,7 +113,7 @@ def withdraw(document_id) private def document_renderer - SpecialistPublisherWiring.get(:specialist_document_renderer) + ManualsPublisherWiring.get(:specialist_document_renderer) end def document_repository diff --git a/app/services/abstract_manual_document_service_registry.rb b/app/services/abstract_manual_document_service_registry.rb index 5380dc124..bc17f3d76 100644 --- a/app/services/abstract_manual_document_service_registry.rb +++ b/app/services/abstract_manual_document_service_registry.rb @@ -6,7 +6,7 @@ require "list_manual_documents_service" require "reorder_manual_documents_service" require "remove_manual_document_service" -require "specialist_publisher_wiring" +require "manuals_publisher_wiring" class AbstractManualDocumentServiceRegistry def preview(context) @@ -78,11 +78,11 @@ def remove(context) private def document_renderer - SpecialistPublisherWiring.get(:specialist_document_renderer) + ManualsPublisherWiring.get(:specialist_document_renderer) end def manual_document_builder - SpecialistPublisherWiring.get(:manual_document_builder) + ManualsPublisherWiring.get(:manual_document_builder) end def manual_repository @@ -90,7 +90,7 @@ def manual_repository end def organisation(slug) - SpecialistPublisherWiring.get(:organisation_fetcher).call(slug) + ManualsPublisherWiring.get(:organisation_fetcher).call(slug) end def publishing_api_draft_manual_exporter @@ -98,7 +98,7 @@ def publishing_api_draft_manual_exporter ManualPublishingAPIExporter.new( publishing_api.method(:put_draft_content_item), organisation(manual.attributes.fetch(:organisation_slug)), - SpecialistPublisherWiring.get(:manual_renderer), + ManualsPublisherWiring.get(:manual_renderer), PublicationLog, manual ).call @@ -110,7 +110,7 @@ def publishing_api_draft_manual_document_exporter ManualSectionPublishingAPIExporter.new( publishing_api.method(:put_draft_content_item), organisation(manual.attributes.fetch(:organisation_slug)), - SpecialistPublisherWiring.get(:manual_document_renderer), + ManualsPublisherWiring.get(:manual_document_renderer), manual, manual_document ).call @@ -118,11 +118,11 @@ def publishing_api_draft_manual_document_exporter end def manual_document_renderer - SpecialistPublisherWiring.get(:manual_document_renderer) + ManualsPublisherWiring.get(:manual_document_renderer) end def publishing_api - SpecialistPublisherWiring.get(:publishing_api) + ManualsPublisherWiring.get(:publishing_api) end def organisations_api diff --git a/app/services/abstract_manual_service_registry.rb b/app/services/abstract_manual_service_registry.rb index 0dcdd93c9..309cfb2e9 100644 --- a/app/services/abstract_manual_service_registry.rb +++ b/app/services/abstract_manual_service_registry.rb @@ -8,7 +8,7 @@ require "republish_manual_service" require "withdraw_manual_service" require "publish_manual_worker" -require "specialist_publisher_wiring" +require "manuals_publisher_wiring" require "manual_observers_registry" class AbstractManualServiceRegistry @@ -93,11 +93,11 @@ def withdraw(manual_id) private def manual_renderer - SpecialistPublisherWiring.get(:manual_renderer) + ManualsPublisherWiring.get(:manual_renderer) end def manual_builder - SpecialistPublisherWiring.get(:manual_builder) + ManualsPublisherWiring.get(:manual_builder) end def repository diff --git a/app/services/manual_document_attachment_service_registry.rb b/app/services/manual_document_attachment_service_registry.rb index 065fef25c..132bca936 100644 --- a/app/services/manual_document_attachment_service_registry.rb +++ b/app/services/manual_document_attachment_service_registry.rb @@ -2,6 +2,6 @@ class ManualDocumentAttachmentServiceRegistry < AbstractManualDocumentAttachment private def repository - SpecialistPublisherWiring.get(:repository_registry).manual_repository + ManualsPublisherWiring.get(:repository_registry).manual_repository end end diff --git a/app/services/manual_document_service_registry.rb b/app/services/manual_document_service_registry.rb index 8151ad093..78e00a7c6 100644 --- a/app/services/manual_document_service_registry.rb +++ b/app/services/manual_document_service_registry.rb @@ -2,6 +2,6 @@ class ManualDocumentServiceRegistry < AbstractManualDocumentServiceRegistry private def manual_repository - SpecialistPublisherWiring.get(:repository_registry).manual_repository + ManualsPublisherWiring.get(:repository_registry).manual_repository end end diff --git a/app/services/manual_service_registry.rb b/app/services/manual_service_registry.rb index 0e2c3ea12..8972d45bf 100644 --- a/app/services/manual_service_registry.rb +++ b/app/services/manual_service_registry.rb @@ -2,11 +2,11 @@ class ManualServiceRegistry < AbstractManualServiceRegistry private def associationless_repository - SpecialistPublisherWiring.get(:repository_registry) + ManualsPublisherWiring.get(:repository_registry) .associationless_manual_repository end def repository - SpecialistPublisherWiring.get(:repository_registry).manual_repository + ManualsPublisherWiring.get(:repository_registry).manual_repository end end diff --git a/app/services/organisational_manual_document_attachment_service_registry.rb b/app/services/organisational_manual_document_attachment_service_registry.rb index 2e19137a6..08f3d6e90 100644 --- a/app/services/organisational_manual_document_attachment_service_registry.rb +++ b/app/services/organisational_manual_document_attachment_service_registry.rb @@ -7,7 +7,7 @@ def initialize(dependencies) attr_reader :organisation_slug def manual_repository_factory - SpecialistPublisherWiring.get(:repository_registry) + ManualsPublisherWiring.get(:repository_registry) .organisation_scoped_manual_repository_factory end diff --git a/app/services/organisational_manual_document_service_registry.rb b/app/services/organisational_manual_document_service_registry.rb index de81ec92b..400ff199c 100644 --- a/app/services/organisational_manual_document_service_registry.rb +++ b/app/services/organisational_manual_document_service_registry.rb @@ -7,7 +7,7 @@ def initialize(dependencies) attr_reader :organisation_slug def manual_repository_factory - SpecialistPublisherWiring.get(:repository_registry). + ManualsPublisherWiring.get(:repository_registry). organisation_scoped_manual_repository_factory end diff --git a/app/services/organisational_manual_service_registry.rb b/app/services/organisational_manual_service_registry.rb index f95c33bfb..f475ebc5a 100644 --- a/app/services/organisational_manual_service_registry.rb +++ b/app/services/organisational_manual_service_registry.rb @@ -15,12 +15,12 @@ def associationless_repository end def manual_repository_factory - SpecialistPublisherWiring.get(:repository_registry) + ManualsPublisherWiring.get(:repository_registry) .organisation_scoped_manual_repository_factory end def associationless_manual_repository_factory - SpecialistPublisherWiring.get(:repository_registry) + ManualsPublisherWiring.get(:repository_registry) .associationless_organisation_scoped_manual_repository_factory end end diff --git a/app/view_adapters/aaib_report_view_adapter.rb b/app/view_adapters/aaib_report_view_adapter.rb index 340bb82f8..e49a20359 100644 --- a/app/view_adapters/aaib_report_view_adapter.rb +++ b/app/view_adapters/aaib_report_view_adapter.rb @@ -24,6 +24,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:aaib_report_finder_schema) + ManualsPublisherWiring.get(:aaib_report_finder_schema) end end diff --git a/app/view_adapters/asylum_support_decision_view_adapter.rb b/app/view_adapters/asylum_support_decision_view_adapter.rb index 8c102bf7c..ae70c7254 100644 --- a/app/view_adapters/asylum_support_decision_view_adapter.rb +++ b/app/view_adapters/asylum_support_decision_view_adapter.rb @@ -26,6 +26,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:asylum_support_decision_finder_schema) + ManualsPublisherWiring.get(:asylum_support_decision_finder_schema) end end diff --git a/app/view_adapters/cma_case_view_adapter.rb b/app/view_adapters/cma_case_view_adapter.rb index 6f76254cf..0689d42e1 100644 --- a/app/view_adapters/cma_case_view_adapter.rb +++ b/app/view_adapters/cma_case_view_adapter.rb @@ -24,7 +24,7 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:cma_case_finder_schema) + ManualsPublisherWiring.get(:cma_case_finder_schema) end end diff --git a/app/view_adapters/countryside_stewardship_grant_view_adapter.rb b/app/view_adapters/countryside_stewardship_grant_view_adapter.rb index 7d38d9cda..76f8663d9 100644 --- a/app/view_adapters/countryside_stewardship_grant_view_adapter.rb +++ b/app/view_adapters/countryside_stewardship_grant_view_adapter.rb @@ -22,7 +22,7 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:countryside_stewardship_grant_finder_schema) + ManualsPublisherWiring.get(:countryside_stewardship_grant_finder_schema) end end diff --git a/app/view_adapters/drug_safety_update_view_adapter.rb b/app/view_adapters/drug_safety_update_view_adapter.rb index 820927410..287dbef9c 100644 --- a/app/view_adapters/drug_safety_update_view_adapter.rb +++ b/app/view_adapters/drug_safety_update_view_adapter.rb @@ -29,6 +29,6 @@ def human_first_published_at end def finder_schema - SpecialistPublisherWiring.get(:drug_safety_update_finder_schema) + ManualsPublisherWiring.get(:drug_safety_update_finder_schema) end end diff --git a/app/view_adapters/employment_appeal_tribunal_decision_view_adapter.rb b/app/view_adapters/employment_appeal_tribunal_decision_view_adapter.rb index 8710e0e7f..51f6d17ad 100644 --- a/app/view_adapters/employment_appeal_tribunal_decision_view_adapter.rb +++ b/app/view_adapters/employment_appeal_tribunal_decision_view_adapter.rb @@ -24,6 +24,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:employment_appeal_tribunal_decision_finder_schema) + ManualsPublisherWiring.get(:employment_appeal_tribunal_decision_finder_schema) end end diff --git a/app/view_adapters/employment_tribunal_decision_view_adapter.rb b/app/view_adapters/employment_tribunal_decision_view_adapter.rb index 5ab6b56f4..af4b7cf4c 100644 --- a/app/view_adapters/employment_tribunal_decision_view_adapter.rb +++ b/app/view_adapters/employment_tribunal_decision_view_adapter.rb @@ -23,6 +23,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:employment_tribunal_decision_finder_schema) + ManualsPublisherWiring.get(:employment_tribunal_decision_finder_schema) end end diff --git a/app/view_adapters/esi_fund_view_adapter.rb b/app/view_adapters/esi_fund_view_adapter.rb index bb87bd843..4ba902600 100644 --- a/app/view_adapters/esi_fund_view_adapter.rb +++ b/app/view_adapters/esi_fund_view_adapter.rb @@ -23,7 +23,7 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:esi_fund_finder_schema) + ManualsPublisherWiring.get(:esi_fund_finder_schema) end end diff --git a/app/view_adapters/international_development_fund_view_adapter.rb b/app/view_adapters/international_development_fund_view_adapter.rb index 4db750ef3..9a2ea3a2f 100644 --- a/app/view_adapters/international_development_fund_view_adapter.rb +++ b/app/view_adapters/international_development_fund_view_adapter.rb @@ -20,7 +20,7 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:international_development_fund_finder_schema) + ManualsPublisherWiring.get(:international_development_fund_finder_schema) end end diff --git a/app/view_adapters/maib_report_view_adapter.rb b/app/view_adapters/maib_report_view_adapter.rb index 919c2cf45..c59455cea 100644 --- a/app/view_adapters/maib_report_view_adapter.rb +++ b/app/view_adapters/maib_report_view_adapter.rb @@ -21,6 +21,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:maib_report_finder_schema) + ManualsPublisherWiring.get(:maib_report_finder_schema) end end diff --git a/app/view_adapters/medical_safety_alert_view_adapter.rb b/app/view_adapters/medical_safety_alert_view_adapter.rb index 194dacfb8..6aae87fb0 100644 --- a/app/view_adapters/medical_safety_alert_view_adapter.rb +++ b/app/view_adapters/medical_safety_alert_view_adapter.rb @@ -18,7 +18,7 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:medical_safety_alert_finder_schema) + ManualsPublisherWiring.get(:medical_safety_alert_finder_schema) end end diff --git a/app/view_adapters/raib_report_view_adapter.rb b/app/view_adapters/raib_report_view_adapter.rb index a341ef637..1448a4c45 100644 --- a/app/view_adapters/raib_report_view_adapter.rb +++ b/app/view_adapters/raib_report_view_adapter.rb @@ -21,6 +21,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:raib_report_finder_schema) + ManualsPublisherWiring.get(:raib_report_finder_schema) end end diff --git a/app/view_adapters/tax_tribunal_decision_view_adapter.rb b/app/view_adapters/tax_tribunal_decision_view_adapter.rb index 3438b620b..9ae49a045 100644 --- a/app/view_adapters/tax_tribunal_decision_view_adapter.rb +++ b/app/view_adapters/tax_tribunal_decision_view_adapter.rb @@ -22,6 +22,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:tax_tribunal_decision_finder_schema) + ManualsPublisherWiring.get(:tax_tribunal_decision_finder_schema) end end diff --git a/app/view_adapters/utaac_decision_view_adapter.rb b/app/view_adapters/utaac_decision_view_adapter.rb index 2ba04d9a3..549243527 100644 --- a/app/view_adapters/utaac_decision_view_adapter.rb +++ b/app/view_adapters/utaac_decision_view_adapter.rb @@ -24,6 +24,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:utaac_decision_finder_schema) + ManualsPublisherWiring.get(:utaac_decision_finder_schema) end end diff --git a/app/view_adapters/vehicle_recalls_and_faults_alert_view_adapter.rb b/app/view_adapters/vehicle_recalls_and_faults_alert_view_adapter.rb index bc4a2d40c..440a9159b 100644 --- a/app/view_adapters/vehicle_recalls_and_faults_alert_view_adapter.rb +++ b/app/view_adapters/vehicle_recalls_and_faults_alert_view_adapter.rb @@ -26,6 +26,6 @@ def self.model_name private def finder_schema - SpecialistPublisherWiring.get(:vehicle_recalls_and_faults_alert_finder_schema) + ManualsPublisherWiring.get(:vehicle_recalls_and_faults_alert_finder_schema) end end diff --git a/app/workers/republish_document_worker.rb b/app/workers/republish_document_worker.rb index f3bc83d49..dd486c1d1 100644 --- a/app/workers/republish_document_worker.rb +++ b/app/workers/republish_document_worker.rb @@ -12,7 +12,7 @@ def perform(document_id, type, params = {}) GdsApi::GovukHeaders.set_header(:govuk_request_id, params["request_id"]) GdsApi::GovukHeaders.set_header(:x_govuk_authenticated_user, params["authenticated_user"]) - services = SpecialistPublisher.document_services(type) + services = ManualsPublisher.document_services(type) services.republish(document_id).call end end diff --git a/bin/publish_cma_cases b/bin/publish_cma_cases index b758075ae..233e825de 100755 --- a/bin/publish_cma_cases +++ b/bin/publish_cma_cases @@ -10,9 +10,9 @@ # $ ./bin/publish_cma_cases < file_with_ids.txt require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" -repository = SpecialistPublisherWiring.get(:repository_registry).for_type("cma_case") +repository = ManualsPublisherWiring.get(:repository_registry).for_type("cma_case") def public_update_at_timestamp_for_document(document) date_of_relevance = document.closed_date.presence || document.opened_date.presence @@ -20,8 +20,8 @@ def public_update_at_timestamp_for_document(document) end def publish_document(document_id, public_updated_at:) - repo = SpecialistPublisherWiring.get(:repository_registry).for_type("cma_case") - builder = SpecialistPublisherWiring.get(:cma_case_builder) + repo = ManualsPublisherWiring.get(:repository_registry).for_type("cma_case") + builder = ManualsPublisherWiring.get(:cma_case_builder) observers = CmaCaseObserversRegistry.new.republication public_updated_at_setter = Proc.new { |document| diff --git a/bin/publish_finders_to_publishing_api b/bin/publish_finders_to_publishing_api index 5c2c892e8..6253ba17c 100755 --- a/bin/publish_finders_to_publishing_api +++ b/bin/publish_finders_to_publishing_api @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" require "publishing_api_finder_publisher" require "publishing_api_finder_loader" diff --git a/bin/publish_finders_to_rummager b/bin/publish_finders_to_rummager index ac765157b..db6d44af9 100755 --- a/bin/publish_finders_to_rummager +++ b/bin/publish_finders_to_rummager @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" require "rummager_finder_publisher" require "multi_json" diff --git a/bin/publish_legacy_report_to_mhra_finder b/bin/publish_legacy_report_to_mhra_finder index 957ed60b0..aa67c3c39 100755 --- a/bin/publish_legacy_report_to_mhra_finder +++ b/bin/publish_legacy_report_to_mhra_finder @@ -1,15 +1,15 @@ #!/usr/bin/env ruby require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" -repository = SpecialistPublisherWiring.get(:repository_registry).for_type(:medical_safety_alert) +repository = ManualsPublisherWiring.get(:repository_registry).for_type(:medical_safety_alert) document = repository.fetch("46147971-ed51-4d1a-88f5-f9ae06ef23f1") document.update(bulk_published: true) document.update(public_updated_at: DateTime.new(2013, 07, 18, 14, 00, 00)) document.publish! repository.store(document) -SpecialistPublisher.document_services("medical_safety_alert").republish("46147971-ed51-4d1a-88f5-f9ae06ef23f1").call +ManualsPublisher.document_services("medical_safety_alert").republish("46147971-ed51-4d1a-88f5-f9ae06ef23f1").call puts "Timestamps updated." diff --git a/bin/republish_documents b/bin/republish_documents index 6f0cfaeb1..07a5edaeb 100755 --- a/bin/republish_documents +++ b/bin/republish_documents @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" def usage $stderr.puts %Q{ @@ -9,7 +9,7 @@ USAGE: #{File.basename(__FILE__)} (all|[format ...]) Available formats: - #{SpecialistPublisher.document_types.sort.join("\n ")} + #{ManualsPublisher.document_types.sort.join("\n ")} } @@ -19,18 +19,18 @@ end usage unless ARGV.any? if ARGV == ["all"] - document_types = SpecialistPublisher.document_types + document_types = ManualsPublisher.document_types else document_types = ARGV end -unsupported_document_types = document_types - SpecialistPublisher.document_types +unsupported_document_types = document_types - ManualsPublisher.document_types if unsupported_document_types.any? raise ArgumentError, "Unrecognised document types: #{unsupported_document_types}. " \ - "If supplied, document types must be in the list: #{SpecialistPublisher.document_types}" + "If supplied, document types must be in the list: #{ManualsPublisher.document_types}" end document_types.each do |type| - services = SpecialistPublisher.document_services(type) + services = ManualsPublisher.document_services(type) services.republish_all.call end diff --git a/bin/republish_manuals b/bin/republish_manuals index 7977fcd8a..715c9edc3 100755 --- a/bin/republish_manuals +++ b/bin/republish_manuals @@ -7,7 +7,7 @@ require "logger" logger = Logger.new(STDOUT) logger.formatter = Logger::Formatter.new -repository = SpecialistPublisherWiring.get(:repository_registry).manual_repository +repository = ManualsPublisherWiring.get(:repository_registry).manual_repository count = repository.all.count diff --git a/bin/republish_withdrawn_document b/bin/republish_withdrawn_document index 766bc7bd0..e032a9d40 100755 --- a/bin/republish_withdrawn_document +++ b/bin/republish_withdrawn_document @@ -1,14 +1,14 @@ #!/usr/bin/env ruby require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" def republish_withdrawn_edition(edition) # Change the state to published edition.update_attribute(:state, "published") # Get the services for the right document type - services = SpecialistPublisher.document_services(edition.document_type) + services = ManualsPublisher.document_services(edition.document_type) # Republish the document to other GOV.UK systems services.republish(edition.document_id).call diff --git a/bin/update_document_timestamp b/bin/update_document_timestamp index 87288b533..7a504e68f 100755 --- a/bin/update_document_timestamp +++ b/bin/update_document_timestamp @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require File.expand_path("../../config/environment", __FILE__) -require "specialist_publisher" +require "manuals_publisher" def usage $stderr.puts %Q{ @@ -9,7 +9,7 @@ USAGE: #{File.basename(__FILE__)} (format ...)(document_id) (date) 1. available formats: - #{SpecialistPublisher.document_types.sort.join("\n ")} + #{ManualsPublisher.document_types.sort.join("\n ")} 2. document_id: To find document_id, login to specialist-publisher in production, go to document page and copy document_id from url. @@ -32,14 +32,14 @@ rescue ArgumentError usage end -unless SpecialistPublisher.document_types.include?(document_type) - raise ArgumentError, "please select document type among available formats provided:\n\n #{SpecialistPublisher.document_types.sort.join("\n ")}" +unless ManualsPublisher.document_types.include?(document_type) + raise ArgumentError, "please select document type among available formats provided:\n\n #{ManualsPublisher.document_types.sort.join("\n ")}" end unless document_id.length > 30 && document_id.length < 40 raise ArgumentError, "document_id invalid" end -repository = SpecialistPublisherWiring.get(:repository_registry).for_type(document_type.to_sym) +repository = ManualsPublisherWiring.get(:repository_registry).for_type(document_type.to_sym) document = repository.fetch(document_id) unless document.published? raise "This document isn't published, so I am refusing to change the public_updated_at and publish it in case it shouldn't be published." @@ -55,6 +55,6 @@ document.update(public_updated_at: date) document.publish! repository.store(document) -SpecialistPublisher.document_services(document_type).republish(document_id).call +ManualsPublisher.document_services(document_type).republish(document_id).call puts "#{document_type} item timestamp updated to #{date}." diff --git a/config/application.rb b/config/application.rb index a759db4c4..9eee90804 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,7 +9,7 @@ Bundler.require(:default, Rails.env) Bundler.require(*Rails.groups(assets: %w(development test))) -module SpecialistPublisher +module ManualsPublisher class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers diff --git a/config/environment.rb b/config/environment.rb index f2ce535e3..3ce2ca186 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,4 +2,4 @@ require File.expand_path("../application", __FILE__) # Initialize the Rails application. -SpecialistPublisher::Application.initialize! +ManualsPublisher::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 0f27597e8..1bb115700 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,4 @@ -SpecialistPublisher::Application.configure do +ManualsPublisher::Application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on diff --git a/config/environments/production.rb b/config/environments/production.rb index 4fa773de6..10e6da06b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,4 @@ -SpecialistPublisher::Application.configure do +ManualsPublisher::Application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. diff --git a/config/environments/test.rb b/config/environments/test.rb index 9d9d4ab65..b614c6bf8 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -SpecialistPublisher::Application.configure do +ManualsPublisher::Application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's diff --git a/config/initializers/govuk_content_models.rb b/config/initializers/govuk_content_models.rb index fc7e70e65..951958ab7 100644 --- a/config/initializers/govuk_content_models.rb +++ b/config/initializers/govuk_content_models.rb @@ -1 +1 @@ -USER_COLLECTION_NAME = "specialist_publisher_users" +USER_COLLECTION_NAME = "manuals_publisher_users" diff --git a/config/initializers/publish_pre_production_finders_feature_flag.rb b/config/initializers/publish_pre_production_finders_feature_flag.rb index ba4440fba..a570dba59 100644 --- a/config/initializers/publish_pre_production_finders_feature_flag.rb +++ b/config/initializers/publish_pre_production_finders_feature_flag.rb @@ -1 +1 @@ -SpecialistPublisher::Application.config.publish_pre_production_finders = ENV["PUBLISH_PRE_PRODUCTION_FINDERS"].present? +ManualsPublisher::Application.config.publish_pre_production_finders = ENV["PUBLISH_PRE_PRODUCTION_FINDERS"].present? diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 6ef4ea9ca..c97eb349e 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -9,4 +9,4 @@ # Make sure your secret_key_base is kept private # if you're sharing your code publicly. -SpecialistPublisher::Application.config.secret_token = "f1a1f8528e523042d7a6a1d5a3ab2c83f22067c629dd16e3c265c29d72bf04171eb16fa12935b31edd3ec374ec662da90bdb3fb5425288e218a6483fd6b4a4a4" +ManualsPublisher::Application.config.secret_token = "f1a1f8528e523042d7a6a1d5a3ab2c83f22067c629dd16e3c265c29d72bf04171eb16fa12935b31edd3ec374ec662da90bdb3fb5425288e218a6483fd6b4a4a4" diff --git a/config/mongoid.yml b/config/mongoid.yml index e6b3652b7..4cbd9ed42 100644 --- a/config/mongoid.yml +++ b/config/mongoid.yml @@ -7,5 +7,5 @@ development: test: host: localhost # Don't want this interfering with a concurrent Panopticon test run - database: govuk_content_specialist_publisher_test + database: govuk_content_manuals_publisher_test autocreate_indexes: true diff --git a/config/routes.rb b/config/routes.rb index b9d9f2ccb..07b57406e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ -require "specialist_publisher" +require "manuals_publisher" -SpecialistPublisher::Application.routes.draw do +ManualsPublisher::Application.routes.draw do mount JasmineRails::Engine => "/specs" if defined?(JasmineRails::Engine) mount GovukAdminTemplate::Engine, at: "/style-guide" if Rails.env.development? @@ -8,7 +8,7 @@ mount Sidekiq::Web => "/sidekiq" end - document_types = SpecialistPublisher.document_types.map(&:pluralize) + document_types = ManualsPublisher.document_types.map(&:pluralize) document_types.each do |type| type_slug = type.to_s.gsub("_", "-") diff --git a/db/migrate/20141006094810_remove_published_style_guide_section.rb b/db/migrate/20141006094810_remove_published_style_guide_section.rb index 8a72d2d3d..1f5239a99 100644 --- a/db/migrate/20141006094810_remove_published_style_guide_section.rb +++ b/db/migrate/20141006094810_remove_published_style_guide_section.rb @@ -39,7 +39,7 @@ def self.repository end def self.repository_factory - SpecialistPublisherWiring.get(:repository_registry). + ManualsPublisherWiring.get(:repository_registry). organisation_scoped_manual_repository_factory end end diff --git a/features/step_definitions/manual_steps.rb b/features/step_definitions/manual_steps.rb index 9e3c1c121..f69a881f3 100644 --- a/features/step_definitions/manual_steps.rb +++ b/features/step_definitions/manual_steps.rb @@ -552,7 +552,7 @@ end When(/^a DevOps specialist withdraws the manual for me$/) do - manual_repository = SpecialistPublisherWiring.get(:repository_registry).manual_repository + manual_repository = ManualsPublisherWiring.get(:repository_registry).manual_repository manual = manual_repository.all.find { |manual| manual.slug == @manual_slug } withdraw_manual_without_ui(manual) diff --git a/features/support/cma_case_helpers.rb b/features/support/cma_case_helpers.rb index bcc438449..ea83ac6cd 100644 --- a/features/support/cma_case_helpers.rb +++ b/features/support/cma_case_helpers.rb @@ -17,7 +17,7 @@ def check_for_cma_case_body_preview end def seed_cases(number_of_cases, state: "draft") - services = SpecialistPublisher.document_services("cma_case") + services = ManualsPublisher.document_services("cma_case") docs = number_of_cases.times.map do services.create( diff --git a/features/support/manual_helpers.rb b/features/support/manual_helpers.rb index 454a85427..642f3cf39 100644 --- a/features/support/manual_helpers.rb +++ b/features/support/manual_helpers.rb @@ -4,7 +4,7 @@ module ManualHelpers include GdsApi::TestHelpers::PublishingApi def manual_repository - SpecialistPublisherWiring.get(:repository_registry).manual_repository + ManualsPublisherWiring.get(:repository_registry).manual_repository end def create_manual(fields, save: true) diff --git a/lib/manual_section_reslugger.rb b/lib/manual_section_reslugger.rb index 7c1a90199..432b14f00 100644 --- a/lib/manual_section_reslugger.rb +++ b/lib/manual_section_reslugger.rb @@ -63,7 +63,7 @@ def validate_new_section_in_content_store def redirect_section PublishingAPIRedirecter.new( - publishing_api: SpecialistPublisherWiring.get(:publishing_api), + publishing_api: ManualsPublisherWiring.get(:publishing_api), entity: current_section_edition, redirect_to_location: "/#{full_new_section_slug}" ).call @@ -112,7 +112,7 @@ def manual_version_number end def manual_repository - SpecialistPublisherWiring.get(:repository_registry).manual_repository + ManualsPublisherWiring.get(:repository_registry).manual_repository end def current_section_edition @@ -148,7 +148,7 @@ def full_section_slug(slug) end def remove_old_section_from_rummager - rummager = SpecialistPublisherWiring.get(:rummager_api) + rummager = ManualsPublisherWiring.get(:rummager_api) rummager.delete_document(RUMMAGER_FORMAT, "/#{full_current_section_slug}") end end diff --git a/lib/publishing_api_finder_publisher.rb b/lib/publishing_api_finder_publisher.rb index e1ac43634..a0cb8dbf7 100644 --- a/lib/publishing_api_finder_publisher.rb +++ b/lib/publishing_api_finder_publisher.rb @@ -35,7 +35,7 @@ def pre_production?(finder) end def should_publish_pre_production_finders? - SpecialistPublisher::Application.config.publish_pre_production_finders + ManualsPublisher::Application.config.publish_pre_production_finders end def export_finder(finder) diff --git a/lib/rummager_finder_publisher.rb b/lib/rummager_finder_publisher.rb index f93ffe2fd..6eaf55a47 100644 --- a/lib/rummager_finder_publisher.rb +++ b/lib/rummager_finder_publisher.rb @@ -30,7 +30,7 @@ def pre_production?(metadata) end def should_publish_pre_production_finders? - SpecialistPublisher::Application.config.publish_pre_production_finders + ManualsPublisher::Application.config.publish_pre_production_finders end def export_finder(metadata) diff --git a/lib/rummager_indexer.rb b/lib/rummager_indexer.rb index d158852bd..148123916 100644 --- a/lib/rummager_indexer.rb +++ b/lib/rummager_indexer.rb @@ -1,4 +1,4 @@ -require "specialist_publisher_wiring" +require "manuals_publisher_wiring" class RummagerIndexer def add(document) @@ -11,6 +11,6 @@ def delete(document) private def api - SpecialistPublisherWiring.get(:rummager_api) + ManualsPublisherWiring.get(:rummager_api) end end diff --git a/spec/exporters/formatters/specialist_document_publishing_api_formatter_spec.rb b/spec/exporters/formatters/specialist_document_publishing_api_formatter_spec.rb index 21a65c59e..21b6c8bb4 100644 --- a/spec/exporters/formatters/specialist_document_publishing_api_formatter_spec.rb +++ b/spec/exporters/formatters/specialist_document_publishing_api_formatter_spec.rb @@ -1,12 +1,12 @@ require "rails_helper" require "formatters/specialist_document_publishing_api_formatter" require "support/govuk_content_schema_helpers" -require "specialist_publisher_wiring" +require "manuals_publisher_wiring" require "specialist_document" RSpec.describe SpecialistDocumentPublishingAPIFormatter do let(:specialist_document_renderer) { - SpecialistPublisherWiring.get(:specialist_document_renderer) + ManualsPublisherWiring.get(:specialist_document_renderer) } let(:formatter) { diff --git a/spec/features/republishing_documents_spec.rb b/spec/features/republishing_documents_spec.rb index 379984bad..10c3bf0c3 100644 --- a/spec/features/republishing_documents_spec.rb +++ b/spec/features/republishing_documents_spec.rb @@ -83,7 +83,7 @@ end it "should push to Publishing API as draft-content" do - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call assert_publishing_api_put_item("/a/b", {}, 0) assert_publishing_api_put_draft_item("/a/b", request_json_matching(publishing_api_fields)) @@ -92,14 +92,14 @@ end it "should send updated_at as last_edited_at timestamp" do - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call assert_publishing_api_put_draft_item("/a/b", request_json_matching(last_edited_at: "2016-05-11T10:56:07+00:00")) end it "should add job to worker queue when republishing all documents" do Sidekiq::Testing.fake! do expect { - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call }.to change(RepublishDocumentWorker.jobs, :size).by(2) end end @@ -115,7 +115,7 @@ end it "should push to Publishing API as content with a 'republish' update_type" do - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call publishing_api_fields[:update_type] = "republish" assert_publishing_api_put_item("/c/d", request_json_matching(publishing_api_fields)) expect(fake_rummager).to have_received(:add_document) @@ -123,7 +123,7 @@ end it "should send updated_at as last_edited_at timestamp" do - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call assert_publishing_api_put_item("/c/d", request_json_matching(last_edited_at: "2016-05-11T10:56:07+00:00")) end end @@ -141,7 +141,7 @@ it "should unpublish using the allow_draft flag" do stub_any_publishing_api_call - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call assert_publishing_api_put_item("/e/f", {}, 0) assert_publishing_api_put_draft_item("/e/f", {}, 1) @@ -183,7 +183,7 @@ end it "should push to Publishing API as content" do - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call assert_publishing_api_put_item("/g/published", { update_type: "republish" }, 1) assert_publishing_api_put_draft_item("/g/draft", { update_type: "major" }, 1) @@ -224,7 +224,7 @@ it "should push to Publishing API and then unpublish the draft" do stub_any_publishing_api_call - SpecialistPublisher.document_services("aaib_report").republish_all.call + ManualsPublisher.document_services("aaib_report").republish_all.call assert_publishing_api_put_item("/i/j", {}, 0) diff --git a/spec/features/republishing_manuals_spec.rb b/spec/features/republishing_manuals_spec.rb index f9f298701..c1b79cb02 100644 --- a/spec/features/republishing_manuals_spec.rb +++ b/spec/features/republishing_manuals_spec.rb @@ -23,7 +23,7 @@ def create_manual_with_sections end def republish_manuals - repository = SpecialistPublisherWiring.get(:repository_registry).manual_repository + repository = ManualsPublisherWiring.get(:repository_registry).manual_repository repository.all.each do |manual| ManualServiceRegistry.new.republish(manual.id).call end diff --git a/spec/lib/publishing_api_finder_publisher_spec.rb b/spec/lib/publishing_api_finder_publisher_spec.rb index fc691c41e..5089eb693 100644 --- a/spec/lib/publishing_api_finder_publisher_spec.rb +++ b/spec/lib/publishing_api_finder_publisher_spec.rb @@ -114,12 +114,12 @@ def make_finder(base_path, overrides = {}) context "and the app is configured to publish pre-production finders" do before do - SpecialistPublisher::Application.config + ManualsPublisher::Application.config .publish_pre_production_finders = true end after do - SpecialistPublisher::Application.config + ManualsPublisher::Application.config .publish_pre_production_finders = false end diff --git a/spec/lib/rummager_finder_publisher_spec.rb b/spec/lib/rummager_finder_publisher_spec.rb index 68d12840e..2e5fe571f 100644 --- a/spec/lib/rummager_finder_publisher_spec.rb +++ b/spec/lib/rummager_finder_publisher_spec.rb @@ -119,12 +119,12 @@ context "and the app is configured to publish pre-production finders" do before do - SpecialistPublisher::Application.config + ManualsPublisher::Application.config .publish_pre_production_finders = true end after do - SpecialistPublisher::Application.config + ManualsPublisher::Application.config .publish_pre_production_finders = false end diff --git a/spec/support/schema_helpers.rb b/spec/support/schema_helpers.rb index 5bbd95186..68a0f9781 100644 --- a/spec/support/schema_helpers.rb +++ b/spec/support/schema_helpers.rb @@ -3,7 +3,7 @@ before do symbol = "#{document_type}_finder_schema".to_sym - allow(SpecialistPublisherWiring).to receive(:get).with(symbol).and_return finder_schema + allow(ManualsPublisherWiring).to receive(:get).with(symbol).and_return finder_schema allow(finder_schema).to receive(:humanized_facet_value).and_return [humanized_facet_value] end end diff --git a/spec/workers/republish_document_worker_spec.rb b/spec/workers/republish_document_worker_spec.rb index 6adc1090d..a7e2d302e 100644 --- a/spec/workers/republish_document_worker_spec.rb +++ b/spec/workers/republish_document_worker_spec.rb @@ -16,7 +16,7 @@ end it "place job in bulk republishing queue" do - expect(SpecialistPublisher).to receive(:document_services) + expect(ManualsPublisher).to receive(:document_services) .and_return(double(:service, republish: double(:thing, call: nil))) Sidekiq::Testing.inline! do