Skip to content

Commit

Permalink
update to use new start accession method
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Mar 3, 2020
1 parent eeabe21 commit d2ad61c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/lib/pre_assembly/digital_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def start_accession
description: 'pre-assembly re-accession',
opening_user_name: bundle.bundle_context.user.sunet_id
}
object_client.accession(version_params)
object_client.accession.start(version_params)
end
end
end
7 changes: 4 additions & 3 deletions spec/lib/pre_assembly/digital_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,17 @@ def add_object_files(extension = 'tif')
end

let(:version_client) { instance_double(Dor::Services::Client::ObjectVersion, current: '5') }
let(:object_client) { instance_double(Dor::Services::Client::Object, version: version_client) }
let(:accession_object) { instance_double(Dor::Services::Client::Accession, start: true) }
let(:object_client) { instance_double(Dor::Services::Client::Object, version: version_client, accession: accession_object ) }
let(:service_url) { Settings.dor_services_url }

context 'when api client is successful' do
before do
allow(object_client).to receive(:accession).and_return(true)
allow(object_client.accession).to receive(:start).and_return(true)
end
it 'starts accession' do
start_accession
expect(object_client).to have_received(:accession).with(version_params)
expect(object_client.accession).to have_received(:start).with(version_params)
end
end

Expand Down

0 comments on commit d2ad61c

Please sign in to comment.