dor-workflow-client 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efd50cf41d262788cb42851599ce7e4556be25329de08a657cca03aa2e76ba23
4
- data.tar.gz: 6a95df393c1110cfb0eb23d10673b7a057cb27c15f326a099d2ee970f7fc21ad
3
+ metadata.gz: bde157b7c4543821f4d8c415bd33d2e0d0eb980036eefd4c621886586e1ef326
4
+ data.tar.gz: 6ca54b914419339a6e51d2b73049fe8f171019c3e9387859269fd85bf76fb64a
5
5
  SHA512:
6
- metadata.gz: 0b438491d28534e0f80789ac107a5b882aa9d21310497105f50ebb42e22324a6c29a905f3da2cda8595febec2d65df6f2e6c3c0535727b4f534df64e8fbfb789
7
- data.tar.gz: b16d230f7f4f86d0edae823233d99be2afd0a6bef875ffb4c2b6a29cd4cbde1f8e06319bd90434c1aa79591c87a429ee7c6bf8c47617f9ea20e2bbbeb2c3f0d1
6
+ metadata.gz: '05798f93f58b1d1c1d8ad7d9ddad69a0a4af5f8a35f1885b4d3469b3cdfcd7f255425938b9ab5adce1775512a9fdaa5fe19b0b51ffefb7b1febc409a984882f8'
7
+ data.tar.gz: bce5b92ce1dea6c63bc9e5cfa2a27609469d85a500269bb825faf044b38c2634e606469d1e228e2218f9b7182d87c1ef3882c53dbe12c525373b5541f58286eb
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Workflow
5
5
  class Client
6
- VERSION = '3.2.0'
6
+ VERSION = '3.3.0'
7
7
  end
8
8
  end
9
9
  end
@@ -187,6 +187,14 @@ module Dor
187
187
  true
188
188
  end
189
189
 
190
+ # Deletes all workflow steps for a particular druid
191
+ # @param [String] pid The id of the object to delete the workflow from
192
+ # @return [Boolean] always true
193
+ def delete_all_workflows(pid:)
194
+ requestor.request "objects/#{pid}/workflows", 'delete'
195
+ true
196
+ end
197
+
190
198
  private
191
199
 
192
200
  attr_reader :requestor
@@ -39,7 +39,7 @@ module Dor
39
39
 
40
40
  delegate :create_workflow, :create_workflow_by_name, :update_workflow_status, :workflow_status,
41
41
  :workflow_xml, :update_workflow_error_status, :all_workflows_xml, :workflows,
42
- :workflow, :delete_workflow, to: :workflow_routes
42
+ :workflow, :delete_workflow, :delete_all_workflows, to: :workflow_routes
43
43
 
44
44
  delegate :lifecycle, :active_lifecycle, :milestones, to: :lifecycle_routes
45
45
 
@@ -20,11 +20,24 @@ RSpec.describe Dor::Workflow::Client::WorkflowRoutes do
20
20
  allow(routes).to receive(:workflow_xml) { xml }
21
21
  end
22
22
 
23
- it 'it returns a workflow' do
23
+ it 'returns a workflow' do
24
24
  expect(routes.workflow(pid: 'druid:mw971zk1113', workflow_name: 'accessionWF')).to be_kind_of Dor::Workflow::Response::Workflow
25
25
  end
26
26
  end
27
27
 
28
+ describe '#delete_all_workflows' do
29
+ subject(:delete_all_workflows) do
30
+ routes.delete_all_workflows(pid: 'druid:mw971zk1113')
31
+ end
32
+ let(:mock_requestor) { instance_double(Dor::Workflow::Client::Requestor, request: nil) }
33
+
34
+ it 'sends a delete request' do
35
+ delete_all_workflows
36
+ expect(mock_requestor).to have_received(:request)
37
+ .with('objects/druid:mw971zk1113/workflows', 'delete')
38
+ end
39
+ end
40
+
28
41
  describe '#all_workflows' do
29
42
  let(:xml) do
30
43
  <<~XML
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-workflow-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willy Mene
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-21 00:00:00.000000000 Z
12
+ date: 2019-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport