Skip to content

Commit

Permalink
Rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LaRita Robinson committed Nov 14, 2023
1 parent 1b85c3f commit 65df06b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions spec/iiif_print/jobs/create_relationships_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions spec/iiif_print/split_pdfs/destroy_pdf_child_works_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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] }

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 65df06b

Please sign in to comment.