Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Upgrade to dor-services-client 0.9 to avoid a deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 9, 2019
1 parent 6e25bb2 commit 0a86cf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dor-services.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.add_dependency 'activesupport', '>= 4.2.10', '< 6.0.0'
s.add_dependency 'confstruct', '~> 0.2.7'
s.add_dependency 'deprecation', '~> 0'
s.add_dependency 'dor-services-client', '~> 0.4'
s.add_dependency 'dor-services-client', '~> 0.9'
s.add_dependency 'equivalent-xml', '~> 0.5', '>= 0.5.1' # 5.0 insufficient
s.add_dependency 'json', '>= 1.8.1'
s.add_dependency 'net-sftp', '~> 2.1'
Expand Down
2 changes: 1 addition & 1 deletion lib/dor/models/concerns/publishable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def publish_metadata

# Call dor services app to have it publish the metadata
def publish_metadata_remotely
Dor::Services::Client.publish(object: pid)
Dor::Services::Client.object(pid).publish
end
deprecation_deprecate publish_metadata_remotely: 'use Dor::Services::Client.publish instead'
end
Expand Down
4 changes: 3 additions & 1 deletion spec/models/concerns/publishable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,12 @@ class PublishableItem < ActiveFedora::Base
before do
Dor::Config.push! { |config| config.dor_services.url 'https://lyberservices-test.stanford.edu/dor' }
stub_request(:post, 'https://lyberservices-test.stanford.edu/dor/v1/objects/druid:ab123cd4567/publish')
allow(Deprecation).to receive(:warn)
end

it 'hits the correct url' do
expect(Deprecation).to receive(:warn)
expect(item.publish_metadata_remotely).to be true
expect(Deprecation).to have_received(:warn)
end
end
end

0 comments on commit 0a86cf7

Please sign in to comment.