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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bde157b7c4543821f4d8c415bd33d2e0d0eb980036eefd4c621886586e1ef326
|
4
|
+
data.tar.gz: 6ca54b914419339a6e51d2b73049fe8f171019c3e9387859269fd85bf76fb64a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '05798f93f58b1d1c1d8ad7d9ddad69a0a4af5f8a35f1885b4d3469b3cdfcd7f255425938b9ab5adce1775512a9fdaa5fe19b0b51ffefb7b1febc409a984882f8'
|
7
|
+
data.tar.gz: bce5b92ce1dea6c63bc9e5cfa2a27609469d85a500269bb825faf044b38c2634e606469d1e228e2218f9b7182d87c1ef3882c53dbe12c525373b5541f58286eb
|
@@ -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
|
data/lib/dor/workflow/client.rb
CHANGED
@@ -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 '
|
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.
|
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-
|
12
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|