Skip to content

Commit

Permalink
Remove hardcoding of dor/ path segment
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jul 27, 2018
1 parent db92c48 commit b27999c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/jobs/release_object_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ def connection

def post_to_release(druid, body)
connection.post do |req|
req.url "/dor/v1/objects/#{druid}/release_tags"
req.url "v1/objects/#{druid}/release_tags"
req.headers['Content-Type'] = 'application/json'
req.body = body
end
end

def post_to_release_wf(druid)
connection.post do |req|
req.url "/dor/v1/objects/#{druid}/apo_workflows/releaseWF"
req.url "v1/objects/#{druid}/apo_workflows/releaseWF"
end
end

Expand Down
8 changes: 4 additions & 4 deletions spec/jobs/release_object_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
subject.perform(bulk_action_no_process_callback.id, params)
pids.each do |pid|
expect(buffer.string).to include "Beginning ReleaseObjectJob for #{pid}"
expect(buffer.string).to include "Release tag failed POST https://dor-services.example.com/dor/v1/objects/#{pid}/release_tags, status: 500"
expect(buffer.string).to include "Release tag failed POST https://dor-services.example.com/v1/objects/#{pid}/release_tags, status: 500"
end
expect(buffer.string).to include 'Adding release tag for SEARCHWORKS'
expect(buffer.string).to_not include 'Release tag added successfully'
Expand Down Expand Up @@ -110,7 +110,7 @@
subject.perform(bulk_action_no_process_callback.id, params)
pids.each do |pid|
expect(buffer.string).to include "Beginning ReleaseObjectJob for #{pid}"
expect(buffer.string).to include "Workflow creation failed POST https://dor-services.example.com/dor/v1/objects/#{pid}/apo_workflows/releaseWF, status: 500"
expect(buffer.string).to include "Workflow creation failed POST https://dor-services.example.com/v1/objects/#{pid}/apo_workflows/releaseWF, status: 500"
end
expect(buffer.string).to include 'Adding release tag for SEARCHWORKS'
expect(buffer.string).to include 'Release tag added successfully'
Expand Down Expand Up @@ -166,11 +166,11 @@
end

def stub_release_tags(druid, status = 201)
stub_request(:post, "https://dor-services.example.com/dor/v1/objects/#{druid}/release_tags")
stub_request(:post, "https://dor-services.example.com/v1/objects/#{druid}/release_tags")
.to_return(status: status)
end

def stub_release_wf(druid, status = 201)
stub_request(:post, "https://dor-services.example.com/dor/v1/objects/#{druid}/apo_workflows/releaseWF")
stub_request(:post, "https://dor-services.example.com/v1/objects/#{druid}/apo_workflows/releaseWF")
.to_return(status: status)
end

0 comments on commit b27999c

Please sign in to comment.