diff --git a/app/actors/iiif_print/actors/cleanup_file_sets_actor_decorator.rb b/app/actors/iiif_print/actors/cleanup_file_sets_actor_decorator.rb index b000a35a..329ed680 100644 --- a/app/actors/iiif_print/actors/cleanup_file_sets_actor_decorator.rb +++ b/app/actors/iiif_print/actors/cleanup_file_sets_actor_decorator.rb @@ -12,9 +12,9 @@ def destroy(env) file_sets.each do |file_set| # we destroy the children before the file_set, because we need the parent relationship IiifPrint::SplitPdfs::DestroyPdfChildWorksService.conditionally_destroy_spawned_children_of( - file_set: file_set, - work: env.curation_concern - ) + file_set: file_set, + work: env.curation_concern + ) end # and now back to your regularly scheduled programming super diff --git a/spec/iiif_print/jobs/create_relationships_job_spec.rb b/spec/iiif_print/jobs/create_relationships_job_spec.rb index ee54370f..4b0bade0 100644 --- a/spec/iiif_print/jobs/create_relationships_job_spec.rb +++ b/spec/iiif_print/jobs/create_relationships_job_spec.rb @@ -13,22 +13,26 @@ module IiifPrint::Jobs let(:parent_record) { WorkWithIiifPrintConfig.new(title: ['required title']) } let(:child_record1) { WorkWithIiifPrintConfig.new(title: ["Child of #{parent_record.id} page 01"]) } let(:child_record2) { WorkWithIiifPrintConfig.new(title: ["Child of #{parent_record.id} page 02"]) } - let(:pending_rel1) { IiifPrint::PendingRelationship.new( + let(:pending_rel1) do + IiifPrint::PendingRelationship.new( parent_id: parent_record.id, child_title: "Child of #{parent_record.id} page 01", child_order: "Child of #{parent_record.id} page 01", parent_model: parent_model, child_model: child_model, file_id: file.id - ) } - let(:pending_rel2) { IiifPrint::PendingRelationship.new( + ) + end + let(:pending_rel2) do + IiifPrint::PendingRelationship.new( parent_id: parent_record.id, child_title: "Child of #{parent_record.id} page 02", child_order: "Child of #{parent_record.id} page 02", parent_model: parent_model, child_model: child_model, file_id: file.id - ) } + ) + end describe '#perform' do before do diff --git a/spec/iiif_print/split_pdfs/destroy_pdf_child_works_service_spec.rb b/spec/iiif_print/split_pdfs/destroy_pdf_child_works_service_spec.rb index 22daa395..4a9d65ad 100644 --- a/spec/iiif_print/split_pdfs/destroy_pdf_child_works_service_spec.rb +++ b/spec/iiif_print/split_pdfs/destroy_pdf_child_works_service_spec.rb @@ -7,23 +7,27 @@ let(:work) { WorkWithIiifPrintConfig.new(title: ['required title'], id: '123') } let(:fileset) { FileSet.new.tap { |fs| fs.save!(validate: false) } } - let(:child_work) { WorkWithIiifPrintConfig.new(title: ["Child of #{work.id} file.pdf page 01"], id: '456', is_child: true ) } - let(:pending_rel1) { IiifPrint::PendingRelationship.new( + let(:child_work) { WorkWithIiifPrintConfig.new(title: ["Child of #{work.id} file.pdf page 01"], id: '456', is_child: true) } + let(:pending_rel1) do + IiifPrint::PendingRelationship.new( parent_id: work.id, child_title: "Child of #{work.id} file.pdf page 01", child_order: "Child of #{work.id} file.pdf page 01", parent_model: WorkWithIiifPrintConfig, child_model: WorkWithIiifPrintConfig, file_id: fileset.id - ) } - let(:pending_rel2) { IiifPrint::PendingRelationship.new( + ) + end + let(:pending_rel2) do + IiifPrint::PendingRelationship.new( parent_id: work.id, child_title: "Child of #{work.id} another.pdf page 01", child_order: "Child of #{work.id} another.pdf page 01", parent_model: WorkWithIiifPrintConfig, child_model: WorkWithIiifPrintConfig, file_id: 'another' - ) } + ) + end # let(:uploaded_pdf_file) { create(:uploaded_pdf_file) } # let(:uploaded_file_ids) { [uploaded_pdf_file.id] } @@ -81,7 +85,7 @@ end it 'deletes only records associated with the specific fileset PDF file' do - expect{ subject }.to change(IiifPrint::PendingRelationship,:count).by(-1) + expect { subject }.to change(IiifPrint::PendingRelationship, :count).by(-1) end end end