dor-workflow-client 5.1.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ RSpec.describe Dor::Workflow::Client do
14
14
  </workflow>
15
15
  EOXML
16
16
  end
17
+ let(:client) { described_class.new connection: mock_http_connection, logger: mock_logger }
17
18
 
18
19
  let(:wf_xml_label) do
19
20
  <<~EOXML
@@ -47,10 +48,9 @@ RSpec.describe Dor::Workflow::Client do
47
48
  @druid = 'druid:123'
48
49
  end
49
50
 
50
- let(:client) { described_class.new connection: mock_http_connection, logger: mock_logger }
51
-
52
51
  describe '#connection' do
53
52
  subject(:conn) { client.requestor.connection }
53
+
54
54
  let(:client) { described_class.new url: 'http://example.com', timeout: 99, logger: mock_logger }
55
55
 
56
56
  it 'has a timeout' do
@@ -89,7 +89,8 @@ RSpec.describe Dor::Workflow::Client do
89
89
  end
90
90
 
91
91
  it 'sets the lane_id param' do
92
- client.create_workflow_by_name(@druid, 'laneIdWF', lane_id: 'foo_lane', version: 1)
92
+ # if the stub isn't correct (params), it will raise an error
93
+ expect { client.create_workflow_by_name(@druid, 'laneIdWF', lane_id: 'foo_lane', version: 1) }.not_to raise_error
93
94
  end
94
95
  end
95
96
 
@@ -101,7 +102,8 @@ RSpec.describe Dor::Workflow::Client do
101
102
  end
102
103
 
103
104
  it 'sets the version param if provided in options hash' do
104
- client.create_workflow_by_name(@druid, 'versionWF', version: 2)
105
+ # if the stub isn't correct (options hash), it will raise an error
106
+ expect { client.create_workflow_by_name(@druid, 'versionWF', version: 2) }.not_to raise_error
105
107
  end
106
108
  end
107
109
  end
@@ -121,21 +123,6 @@ RSpec.describe Dor::Workflow::Client do
121
123
  end
122
124
  end
123
125
 
124
- describe '#workflow_templates' do
125
- subject(:workflow_templates) { client.workflow_templates }
126
-
127
- let(:workflow_template_client) { instance_double Dor::Workflow::Client::WorkflowTemplate, all: 'data' }
128
-
129
- before do
130
- allow(Dor::Workflow::Client::WorkflowTemplate).to receive(:new).and_return(workflow_template_client)
131
- end
132
-
133
- it 'delegates to the client' do
134
- expect(workflow_templates).to eq 'data'
135
- expect(workflow_template_client).to have_received(:all)
136
- end
137
- end
138
-
139
126
  describe '#templates' do
140
127
  subject(:templates) { client.templates }
141
128
 
@@ -145,7 +132,16 @@ RSpec.describe Dor::Workflow::Client do
145
132
  end
146
133
 
147
134
  describe '#workflow_status' do
135
+ subject(:workflow_status) { client.workflow_status(druid: druid, workflow: workflow_name, process: step_name) }
136
+
148
137
  let(:repo) { nil }
138
+ let(:step_name) { 'registrar-approval' }
139
+ let(:workflow_name) { 'etdSubmitWF' }
140
+ let(:status) { 200 }
141
+ let(:response) do
142
+ [status, {}, xml]
143
+ end
144
+ let(:xml) { '' }
149
145
  let(:druid) { @druid }
150
146
  let(:stubs) do
151
147
  Faraday::Adapter::Test::Stubs.new do |stub|
@@ -155,22 +151,13 @@ RSpec.describe Dor::Workflow::Client do
155
151
  end
156
152
  end
157
153
 
158
- subject { client.workflow_status(druid: druid, workflow: workflow_name, process: step_name) }
159
- let(:step_name) { 'registrar-approval' }
160
- let(:workflow_name) { 'etdSubmitWF' }
161
- let(:status) { 200 }
162
- let(:response) do
163
- [status, {}, xml]
164
- end
165
- let(:xml) { '' }
166
-
167
154
  context 'when a single result is returned' do
168
155
  let(:xml) do
169
156
  '<workflow><process name="registrar-approval" status="completed" /></workflow>'
170
157
  end
171
158
 
172
159
  it 'returns status as a string' do
173
- expect(subject).to eq('completed')
160
+ expect(workflow_status).to eq('completed')
174
161
  end
175
162
  end
176
163
 
@@ -181,7 +168,7 @@ RSpec.describe Dor::Workflow::Client do
181
168
  end
182
169
 
183
170
  it 'returns the status for the highest version' do
184
- expect(subject).to eq('waiting')
171
+ expect(workflow_status).to eq('waiting')
185
172
  end
186
173
  end
187
174
 
@@ -189,7 +176,7 @@ RSpec.describe Dor::Workflow::Client do
189
176
  let(:status) { 404 }
190
177
 
191
178
  it 'throws the missing workflow exception' do
192
- expect { subject }.to raise_error Dor::MissingWorkflowException
179
+ expect { workflow_status }.to raise_error Dor::MissingWorkflowException
193
180
  end
194
181
  end
195
182
 
@@ -197,7 +184,7 @@ RSpec.describe Dor::Workflow::Client do
197
184
  let(:status) { 422 }
198
185
 
199
186
  it 'throws an exception' do
200
- expect { subject }.to raise_error Dor::WorkflowException
187
+ expect { workflow_status }.to raise_error Dor::WorkflowException
201
188
  end
202
189
  end
203
190
 
@@ -207,7 +194,7 @@ RSpec.describe Dor::Workflow::Client do
207
194
  end
208
195
 
209
196
  it 'throws an exception' do
210
- expect { subject }.to raise_error Dor::WorkflowException, "Unable to parse response:\nsomething not xml"
197
+ expect { workflow_status }.to raise_error Dor::WorkflowException, "Unable to parse response:\nsomething not xml"
211
198
  end
212
199
  end
213
200
 
@@ -218,36 +205,11 @@ RSpec.describe Dor::Workflow::Client do
218
205
  let(:step_name) { 'publish' }
219
206
 
220
207
  it 'returns nil' do
221
- expect(subject).to be_nil
208
+ expect(workflow_status).to be_nil
222
209
  end
223
210
  end
224
211
  end
225
212
 
226
- describe '#all_workflows_xml' do
227
- subject(:all_workflows_xml) { client.all_workflows_xml('druid:123') }
228
-
229
- let(:workflow) { 'etdSubmitWF' }
230
- let(:xml) do
231
- <<~XML
232
- <workflows>
233
- <workflow id="etdSubmitWF"><process name="registrar-approval" status="completed" /></workflow>
234
- <workflow id="etdSubmitWF"><process name="registrar-approval" status="completed" /></workflow>
235
- </workflows>
236
- XML
237
- end
238
- let(:stubs) do
239
- Faraday::Adapter::Test::Stubs.new do |stub|
240
- stub.get('objects/druid:123/workflows') do |_env|
241
- [200, {}, xml]
242
- end
243
- end
244
- end
245
-
246
- it 'returns the xml for a given druid' do
247
- expect(all_workflows_xml).to eq(xml)
248
- end
249
- end
250
-
251
213
  describe '#workflows' do
252
214
  let(:xml) { '<workflow id="accessionWF"><process name="publish" status="completed" /></workflow>' }
253
215
  let(:stubs) do
@@ -323,8 +285,8 @@ RSpec.describe Dor::Workflow::Client do
323
285
  end
324
286
  end
325
287
 
326
- context '#objects_for_workstep' do
327
- before(:all) do
288
+ describe '#objects_for_workstep' do
289
+ before do
328
290
  @workflow = 'googleScannedBookWF'
329
291
  @completed = 'google-download'
330
292
  @waiting = 'process-content'
@@ -353,8 +315,8 @@ RSpec.describe Dor::Workflow::Client do
353
315
  end
354
316
  end
355
317
 
356
- context 'a query using qualified workflow names for completed and waiting' do
357
- before :each do
318
+ context 'with a query using qualified workflow names for completed and waiting' do
319
+ before do
358
320
  @qualified_waiting = "#{@workflow}:#{@waiting}"
359
321
  @qualified_completed = "#{@workflow}:#{@completed}"
360
322
  end
@@ -376,24 +338,28 @@ RSpec.describe Dor::Workflow::Client do
376
338
  let(:laneid) { 'default' }
377
339
  end
378
340
  end
341
+
379
342
  describe 'explicit lane_id' do
380
343
  it_behaves_like 'lane-aware' do
381
344
  let(:laneid) { 'lane1' }
382
345
  end
383
346
  end
384
347
 
385
- context 'URI string creation' do
386
- before :each do
348
+ context 'with URI string creation' do
349
+ before do
387
350
  @xml = %(<objects count="1"><object id="druid:ab123de4567"/></objects>)
388
351
  end
352
+
389
353
  it 'with only one completed step passed in as a String' do
390
354
  allow(mock_http_connection).to receive(:get).with("workflow_queue?waiting=#{@qualified_waiting}&completed=#{@qualified_completed}&lane-id=default").and_return(double(Faraday::Response, body: @xml))
391
355
  expect(client.objects_for_workstep(@qualified_completed, @qualified_waiting)).to eq(['druid:ab123de4567'])
392
356
  end
357
+
393
358
  it 'without any completed steps, only waiting' do
394
359
  allow(mock_http_connection).to receive(:get).with("workflow_queue?waiting=#{@qualified_waiting}&lane-id=default").and_return(double(Faraday::Response, body: @xml))
395
360
  expect(client.objects_for_workstep(nil, @qualified_waiting)).to eq(['druid:ab123de4567'])
396
361
  end
362
+
397
363
  it 'same but with lane_id' do
398
364
  allow(mock_http_connection).to receive(:get).with("workflow_queue?waiting=#{@qualified_waiting}&lane-id=lane1").and_return(double(Faraday::Response, body: @xml))
399
365
  expect(client.objects_for_workstep(nil, @qualified_waiting, 'lane1')).to eq(['druid:ab123de4567'])
@@ -402,8 +368,8 @@ RSpec.describe Dor::Workflow::Client do
402
368
  end
403
369
  end
404
370
 
405
- context 'get empty workflow queue' do
406
- before(:all) do
371
+ context 'when empty workflow queue' do
372
+ before do
407
373
  @workflow = 'googleScannedBookWF'
408
374
  @completed = 'google-download'
409
375
  @waiting = 'process-content'
@@ -422,134 +388,21 @@ RSpec.describe Dor::Workflow::Client do
422
388
  end
423
389
  end
424
390
 
425
- context 'get errored workflow steps' do
426
- before(:all) do
427
- @workflow = 'accessionWF'
428
- @step = 'publish'
429
- end
430
-
431
- let(:stubs) do
432
- Faraday::Adapter::Test::Stubs.new do |stub|
433
- stub.get("/workflow_queue?error=#{@step}&workflow=#{@workflow}") do |_env|
434
- [200, {}, <<-EOXML]
435
- <objects count="1">
436
- <object id="druid:ab123cd4567" errorMessage="This is an error message"/>
437
- </objects>
438
- EOXML
439
- end
440
- end
441
- end
442
-
443
- describe 'errored_objects_for_workstep' do
444
- it 'returns error messages for errored objects' do
445
- expect(client.errored_objects_for_workstep(@workflow, @step)).to eq('druid:ab123cd4567' => 'This is an error message')
446
- end
447
- end
448
-
449
- describe 'count_errored_for_workstep' do
450
- it 'counts how many steps are errored out' do
451
- expect(client.count_errored_for_workstep(@workflow, @step)).to eq(1)
452
- end
453
- end
454
- end
455
-
456
- describe '#count_queued_for_workstep' do
457
- before(:all) do
458
- @workflow = 'accessionWF'
459
- @step = 'publish'
460
- end
461
-
462
- let(:stubs) do
463
- Faraday::Adapter::Test::Stubs.new do |stub|
464
- stub.get("/workflow_queue?queued=#{@step}&workflow=#{@workflow}") do |_env|
465
- [200, {}, <<-EOXML]
466
- <objects count="1">
467
- <object id="druid:ab123cd4567"/>
468
- </objects>
469
- EOXML
470
- end
471
- end
472
- end
473
-
474
- it 'counts how many steps are errored out' do
475
- expect(client.count_queued_for_workstep(@workflow, @step)).to eq(1)
476
- end
477
- end
478
-
479
- describe '#count_objects_in_step' do
480
- before(:all) do
481
- @workflow = 'sdrIngestWF'
482
- @step = 'start-ingest'
483
- @type = 'waiting'
484
- end
485
-
486
- let(:stubs) do
487
- Faraday::Adapter::Test::Stubs.new do |stub|
488
- stub.get("/workflow_queue?workflow=#{@workflow}&#{@type}=#{@step}") do |_env|
489
- [200, {}, <<-EOXML]
490
- <objects count="1">
491
- <object id="druid:oo000ra0001" url="null/fedora/objects/druid:oo000ra0001"/>
492
- </objects>
493
- EOXML
494
- end
495
- end
496
- end
497
-
498
- it 'counts how many objects are at the type of step' do
499
- expect(client.count_objects_in_step(@workflow, @step, @type)).to eq(1)
500
- end
501
- end
502
-
503
391
  describe '#delete_workflow' do
504
392
  let(:stubs) do
505
393
  Faraday::Adapter::Test::Stubs.new do |stub|
506
394
  stub.delete(url) { |_env| [202, {}, ''] }
507
395
  end
508
396
  end
509
-
510
397
  let(:url) { "/objects/#{@druid}/workflows/accessionWF?version=5" }
511
398
 
512
- it 'sends a delete request to the workflow service' do
513
- expect(mock_http_connection).to receive(:delete).with(url).and_call_original
514
- client.delete_workflow(druid: @druid, workflow: 'accessionWF', version: 5)
515
- end
516
- end
517
-
518
- describe '.stale_queued_workflows' do
519
- let(:stubs) do
520
- Faraday::Adapter::Test::Stubs.new do |stub|
521
- stub.get('workflow_queue/all_queued?hours-ago=24&limit=100') do |_env|
522
- [200, {}, <<-XML]
523
- <workflows>
524
- <workflow laneId="lane1" note="annotation" lifecycle="in-process" errorText="stacktrace" errorMessage="NullPointerException" elapsed="1.173" repository="dor" attempts="0" datetime="2008-11-15T13:30:00-0800" status="waiting" process="content-metadata" name="accessionWF" druid="dr:123"/>
525
- <workflow laneId="lane2" note="annotation" lifecycle="in-process" errorText="stacktrace" errorMessage="NullPointerException" elapsed="1.173" repository="dor" attempts="0" datetime="2008-11-15T13:30:00-0800" status="waiting" process="jp2-create" name="assemblyWF" druid="dr:456"/>
526
- </workflows>
527
- XML
528
- end
529
- end
530
- end
531
-
532
- it 'returns an Array of Hashes containing each workflow step' do
533
- ah = client.stale_queued_workflows hours_ago: 24, limit: 100
534
- expected = [
535
- { workflow: 'accessionWF', step: 'content-metadata', druid: 'dr:123', lane_id: 'lane1' },
536
- { workflow: 'assemblyWF', step: 'jp2-create', druid: 'dr:456', lane_id: 'lane2' }
537
- ]
538
- expect(ah).to eql(expected)
539
- end
540
- end
541
-
542
- describe '.count_stale_queued_workflows' do
543
- let(:stubs) do
544
- Faraday::Adapter::Test::Stubs.new do |stub|
545
- stub.get('workflow_queue/all_queued?hours-ago=48&count-only=true') do |_env|
546
- [200, {}, '<objects count="10"/>']
547
- end
548
- end
399
+ before do
400
+ allow(mock_http_connection).to receive(:delete).with(url).and_call_original
549
401
  end
550
402
 
551
- it 'returns the number of queued workflow steps' do
552
- expect(client.count_stale_queued_workflows(hours_ago: 48)).to eq(10)
403
+ it 'sends a delete request to the workflow service' do
404
+ client.delete_workflow(druid: @druid, workflow: 'accessionWF', version: 5)
405
+ expect(mock_http_connection).to have_received(:delete).with(url)
553
406
  end
554
407
  end
555
408
 
@@ -3,9 +3,10 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  RSpec.describe Dor::Workflow::Response::Process do
6
- let(:parent) { Dor::Workflow::Response::Workflow.new(xml: xml) }
7
6
  subject(:instance) { parent.process_for_recent_version(name: 'start-assembly') }
8
7
 
8
+ let(:parent) { Dor::Workflow::Response::Workflow.new(xml: xml) }
9
+
9
10
  describe '#pid' do
10
11
  subject { instance.pid }
11
12
 
@@ -16,6 +17,7 @@ RSpec.describe Dor::Workflow::Response::Process do
16
17
  </workflow>
17
18
  XML
18
19
  end
20
+
19
21
  it { is_expected.to eq 'druid:mw971zk1113' }
20
22
  end
21
23
 
@@ -29,6 +31,7 @@ RSpec.describe Dor::Workflow::Response::Process do
29
31
  </workflow>
30
32
  XML
31
33
  end
34
+
32
35
  it { is_expected.to eq 'assemblyWF' }
33
36
  end
34
37
 
@@ -42,6 +45,7 @@ RSpec.describe Dor::Workflow::Response::Process do
42
45
  </workflow>
43
46
  XML
44
47
  end
48
+
45
49
  it { is_expected.to eq 'start-assembly' }
46
50
  end
47
51
 
@@ -55,6 +59,7 @@ RSpec.describe Dor::Workflow::Response::Process do
55
59
  </workflow>
56
60
  XML
57
61
  end
62
+
58
63
  it { is_expected.to eq 'default' }
59
64
  end
60
65
  end
@@ -14,6 +14,7 @@ RSpec.describe Dor::Workflow::Response::Workflow do
14
14
  </workflow>
15
15
  XML
16
16
  end
17
+
17
18
  it { is_expected.to eq 'druid:mw971zk1113' }
18
19
  end
19
20
 
@@ -26,11 +27,13 @@ RSpec.describe Dor::Workflow::Response::Workflow do
26
27
  </workflow>
27
28
  XML
28
29
  end
30
+
29
31
  it { is_expected.to eq 'assemblyWF' }
30
32
  end
31
33
 
32
34
  describe '#complete?' do
33
35
  subject { instance.complete? }
36
+
34
37
  context 'when all steps are complete' do
35
38
  let(:xml) do
36
39
  <<~XML
@@ -40,6 +43,7 @@ RSpec.describe Dor::Workflow::Response::Workflow do
40
43
  </workflow>
41
44
  XML
42
45
  end
46
+
43
47
  it { is_expected.to be true }
44
48
  end
45
49
 
@@ -52,6 +56,7 @@ RSpec.describe Dor::Workflow::Response::Workflow do
52
56
  </workflow>
53
57
  XML
54
58
  end
59
+
55
60
  it { is_expected.to be false }
56
61
  end
57
62
  end
@@ -68,6 +73,7 @@ RSpec.describe Dor::Workflow::Response::Workflow do
68
73
  </workflow>
69
74
  XML
70
75
  end
76
+
71
77
  it { is_expected.to be false }
72
78
  end
73
79
 
@@ -81,6 +87,7 @@ RSpec.describe Dor::Workflow::Response::Workflow do
81
87
  </workflow>
82
88
  XML
83
89
  end
90
+
84
91
  it { is_expected.to be true }
85
92
  end
86
93
  end
@@ -14,11 +14,12 @@ RSpec.describe Dor::Workflow::Response::Workflows do
14
14
  </workflows>
15
15
  XML
16
16
  end
17
+
17
18
  it { is_expected.to eq 'druid:mw971zk1113' }
18
19
  end
19
20
 
20
21
  describe '#workflows' do
21
- subject { instance.workflows }
22
+ subject(:workflows) { instance.workflows }
22
23
 
23
24
  let(:xml) do
24
25
  <<~XML
@@ -32,8 +33,8 @@ RSpec.describe Dor::Workflow::Response::Workflows do
32
33
  end
33
34
 
34
35
  it 'has children' do
35
- expect(subject).to all(be_kind_of Dor::Workflow::Response::Workflow)
36
- expect(subject.map(&:workflow_name)).to eq %w[assemblyWF sdrPreservationWF]
36
+ expect(workflows).to all(be_kind_of Dor::Workflow::Response::Workflow)
37
+ expect(workflows.map(&:workflow_name)).to eq %w[assemblyWF sdrPreservationWF]
37
38
  end
38
39
  end
39
40
 
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: 5.1.0
4
+ version: 7.0.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: 2022-08-05 00:00:00.000000000 Z
12
+ date: 2024-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -101,118 +101,6 @@ dependencies:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '2.1'
104
- - !ruby/object:Gem::Dependency
105
- name: rake
106
- requirement: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- type: :development
112
- prerelease: false
113
- version_requirements: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- - !ruby/object:Gem::Dependency
119
- name: rspec
120
- requirement: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '3.3'
125
- type: :development
126
- prerelease: false
127
- version_requirements: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '3.3'
132
- - !ruby/object:Gem::Dependency
133
- name: rubocop
134
- requirement: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '1.24'
139
- type: :development
140
- prerelease: false
141
- version_requirements: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '1.24'
146
- - !ruby/object:Gem::Dependency
147
- name: rubocop-rake
148
- requirement: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- type: :development
154
- prerelease: false
155
- version_requirements: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- - !ruby/object:Gem::Dependency
161
- name: rubocop-rspec
162
- requirement: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '2.1'
167
- type: :development
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '2.1'
174
- - !ruby/object:Gem::Dependency
175
- name: simplecov
176
- requirement: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- type: :development
182
- prerelease: false
183
- version_requirements: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- - !ruby/object:Gem::Dependency
189
- name: webmock
190
- requirement: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- type: :development
196
- prerelease: false
197
- version_requirements: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- - !ruby/object:Gem::Dependency
203
- name: yard
204
- requirement: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- type: :development
210
- prerelease: false
211
- version_requirements: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
104
  description: Enables Ruby manipulation of the DOR Workflow Service via its REST API
217
105
  email:
218
106
  - wmene@stanford.edu
@@ -249,18 +137,18 @@ files:
249
137
  - lib/dor/workflow/response/workflow.rb
250
138
  - lib/dor/workflow/response/workflows.rb
251
139
  - lib/dor/workflow_exception.rb
252
- - spec/models/response/process_spec.rb
253
- - spec/models/response/workflow_spec.rb
254
- - spec/models/response/workflows_spec.rb
140
+ - spec/dor/workflow/client/connection_factory_spec.rb
141
+ - spec/dor/workflow/client/lifecycle_routes_spec.rb
142
+ - spec/dor/workflow/client/requestor_spec.rb
143
+ - spec/dor/workflow/client/status_spec.rb
144
+ - spec/dor/workflow/client/version_routes_spec.rb
145
+ - spec/dor/workflow/client/workflow_routes_spec.rb
146
+ - spec/dor/workflow/client/workflow_template_spec.rb
147
+ - spec/dor/workflow/client_spec.rb
148
+ - spec/dor/workflow/response/process_spec.rb
149
+ - spec/dor/workflow/response/workflow_spec.rb
150
+ - spec/dor/workflow/response/workflows_spec.rb
255
151
  - spec/spec_helper.rb
256
- - spec/workflow/client/connection_factory_spec.rb
257
- - spec/workflow/client/lifecycle_routes_spec.rb
258
- - spec/workflow/client/requestor_spec.rb
259
- - spec/workflow/client/status_spec.rb
260
- - spec/workflow/client/version_routes_spec.rb
261
- - spec/workflow/client/workflow_routes_spec.rb
262
- - spec/workflow/client/workflow_template_spec.rb
263
- - spec/workflow/client_spec.rb
264
152
  homepage: https://consul.stanford.edu/display/DOR/DOR+services#DORservices-initializeworkflow
265
153
  licenses: []
266
154
  metadata:
@@ -273,7 +161,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
273
161
  requirements:
274
162
  - - ">="
275
163
  - !ruby/object:Gem::Version
276
- version: '2.7'
164
+ version: '3.0'
277
165
  required_rubygems_version: !ruby/object:Gem::Requirement
278
166
  requirements:
279
167
  - - ">="
@@ -10,6 +10,8 @@ RSpec.describe Dor::Workflow::Client::LifecycleRoutes do
10
10
  let(:druid) { 'druid:gv054hp4128' }
11
11
 
12
12
  describe '#milestones' do
13
+ subject(:milestones) { routes.milestones(druid: druid) }
14
+
13
15
  let(:ng_xml) { Nokogiri::XML(xml) }
14
16
  let(:xml) do
15
17
  '<?xml version="1.0" encoding="UTF-8"?><lifecycle objectId="druid:gv054hp4128"><milestone date="2012-01-26T21:06:54-0800" version="2">published</milestone></lifecycle>'
@@ -19,8 +21,6 @@ RSpec.describe Dor::Workflow::Client::LifecycleRoutes do
19
21
  allow(routes).to receive(:query_lifecycle).and_return(ng_xml)
20
22
  end
21
23
 
22
- subject(:milestones) { routes.milestones(druid: druid) }
23
-
24
24
  it 'includes the version in with the milestones' do
25
25
  expect(milestones.first[:milestone]).to eq('published')
26
26
  expect(milestones.first[:version]).to eq('2')