resque-approve 0.0.4 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -67,6 +67,14 @@ RSpec.describe Resque::Plugins::Approve do
67
67
  expect(BasicJob.auto_delete_approval_key).to be_falsey
68
68
  end
69
69
 
70
+ it "has max_active_jobs" do
71
+ expect(BasicJob.max_active_jobs).to eq(-1)
72
+ end
73
+
74
+ it "has default_queue_name" do
75
+ expect(BasicJob.default_queue_name).to eq "Some_Queue"
76
+ end
77
+
70
78
  it "does not delay jobs that are enqueued without delay args" do
71
79
  Resque.enqueue BasicJob, *test_args_with_hash
72
80
 
@@ -198,4 +206,49 @@ RSpec.describe Resque::Plugins::Approve do
198
206
  expect { BasicJob.before_enqueue_approve(*test_args_with_hash_approve) }.not_to(change { test_args_with_hash })
199
207
  end
200
208
  end
209
+
210
+ describe "approval methods" do
211
+ let(:pending_job_queue) do
212
+ instance_double(Resque::Plugins::Approve::PendingJobQueue,
213
+ approve_all: nil,
214
+ approve_one: nil,
215
+ approve_num: nil,
216
+ remove_all: nil,
217
+ remove_one: nil)
218
+ end
219
+
220
+ before(:each) do
221
+ allow(Resque::Plugins::Approve::PendingJobQueue).to receive(:new).with("Some_Queue").and_return pending_job_queue
222
+ end
223
+
224
+ it "responds to approve" do
225
+ BasicJob.approve
226
+
227
+ expect(pending_job_queue).to have_received(:approve_all)
228
+ end
229
+
230
+ it "responds to approve_one" do
231
+ BasicJob.approve_one
232
+
233
+ expect(pending_job_queue).to have_received(:approve_one)
234
+ end
235
+
236
+ it "responds to approve_one" do
237
+ BasicJob.approve_num 12
238
+
239
+ expect(pending_job_queue).to have_received(:approve_num).with(12)
240
+ end
241
+
242
+ it "responds to remove" do
243
+ BasicJob.remove
244
+
245
+ expect(pending_job_queue).to have_received(:remove_all)
246
+ end
247
+
248
+ it "responds to remove_one" do
249
+ BasicJob.remove_one
250
+
251
+ expect(pending_job_queue).to have_received(:remove_one)
252
+ end
253
+ end
201
254
  end
@@ -1,149 +1,181 @@
1
- example_id | status | run_time |
2
- ---------------------------------------------------- | ------- | --------------- |
3
- ./spec/approve/approval_key_list_spec.rb[1:1:1] | passed | 0.00081 seconds |
4
- ./spec/approve/approval_key_list_spec.rb[1:1:2] | passed | 0.00058 seconds |
5
- ./spec/approve/approval_key_list_spec.rb[1:1:3] | passed | 0.0008 seconds |
6
- ./spec/approve/approval_key_list_spec.rb[1:2:1] | passed | 0.00329 seconds |
7
- ./spec/approve/approval_key_list_spec.rb[1:2:2] | passed | 0.00419 seconds |
8
- ./spec/approve/approval_key_list_spec.rb[1:3:1] | passed | 0.00211 seconds |
9
- ./spec/approve/approval_key_list_spec.rb[1:3:2] | passed | 0.00264 seconds |
10
- ./spec/approve/approval_key_list_spec.rb[1:4:1] | passed | 0.00337 seconds |
11
- ./spec/approve/approval_key_list_spec.rb[1:4:2] | passed | 0.00542 seconds |
12
- ./spec/approve/approval_key_list_spec.rb[1:4:3] | passed | 0.00462 seconds |
13
- ./spec/approve/approval_key_list_spec.rb[1:5:1] | passed | 0.01753 seconds |
14
- ./spec/approve/approval_key_list_spec.rb[1:5:2] | passed | 0.01523 seconds |
15
- ./spec/approve/approval_key_list_spec.rb[1:5:3] | passed | 0.01682 seconds |
16
- ./spec/approve/approval_key_list_spec.rb[1:6:1] | passed | 0.03665 seconds |
17
- ./spec/approve/approval_key_list_spec.rb[1:6:2] | passed | 0.02217 seconds |
18
- ./spec/approve/approval_key_list_spec.rb[1:6:3] | passed | 0.02712 seconds |
19
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:1] | passed | 0.37457 seconds |
20
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:2] | passed | 0.37665 seconds |
21
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:3] | passed | 0.37041 seconds |
22
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:4] | passed | 0.37069 seconds |
23
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:5] | passed | 0.37388 seconds |
24
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:6] | passed | 0.37706 seconds |
25
- ./spec/approve/approval_key_list_spec.rb[1:7:1:1:7] | passed | 0.3846 seconds |
26
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:1] | passed | 0.38664 seconds |
27
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:2] | passed | 0.38505 seconds |
28
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:3] | passed | 0.46689 seconds |
29
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:4] | passed | 0.38358 seconds |
30
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:5] | passed | 0.37826 seconds |
31
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:6] | passed | 0.39196 seconds |
32
- ./spec/approve/approval_key_list_spec.rb[1:7:2:1:7] | passed | 0.39493 seconds |
33
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:1] | passed | 0.38132 seconds |
34
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:2] | passed | 0.37191 seconds |
35
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:3] | passed | 0.39882 seconds |
36
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:4] | passed | 0.38268 seconds |
37
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:5] | passed | 0.39867 seconds |
38
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:6] | passed | 0.3975 seconds |
39
- ./spec/approve/approval_key_list_spec.rb[1:7:3:1:7] | passed | 0.388 seconds |
40
- ./spec/approve/approval_key_list_spec.rb[1:8:1] | passed | 0.02978 seconds |
41
- ./spec/approve/approval_key_list_spec.rb[1:9:1] | passed | 0.03033 seconds |
42
- ./spec/approve/cleaner_spec.rb[1:1:1] | passed | 0.01382 seconds |
43
- ./spec/approve/cleaner_spec.rb[1:1:2] | passed | 0.00929 seconds |
44
- ./spec/approve/cleaner_spec.rb[1:1:3] | passed | 0.00982 seconds |
45
- ./spec/approve/cleaner_spec.rb[1:2:1] | passed | 0.01796 seconds |
46
- ./spec/approve/cleaner_spec.rb[1:2:2] | passed | 0.01627 seconds |
47
- ./spec/approve/cleaner_spec.rb[1:3:1] | passed | 0.00923 seconds |
48
- ./spec/approve/pending_job_queue_spec.rb[1:1:1] | passed | 0.01558 seconds |
49
- ./spec/approve/pending_job_queue_spec.rb[1:1:2] | passed | 0.00899 seconds |
50
- ./spec/approve/pending_job_queue_spec.rb[1:1:3] | passed | 0.01351 seconds |
51
- ./spec/approve/pending_job_queue_spec.rb[1:1:4] | passed | 0.01493 seconds |
52
- ./spec/approve/pending_job_queue_spec.rb[1:1:5:1] | passed | 0.01731 seconds |
53
- ./spec/approve/pending_job_queue_spec.rb[1:2:1] | passed | 0.01576 seconds |
54
- ./spec/approve/pending_job_queue_spec.rb[1:2:2] | passed | 0.02713 seconds |
55
- ./spec/approve/pending_job_queue_spec.rb[1:3:1] | passed | 0.01337 seconds |
56
- ./spec/approve/pending_job_queue_spec.rb[1:3:2] | passed | 0.01639 seconds |
57
- ./spec/approve/pending_job_queue_spec.rb[1:4:1] | passed | 0.01908 seconds |
58
- ./spec/approve/pending_job_queue_spec.rb[1:4:2] | passed | 0.01246 seconds |
59
- ./spec/approve/pending_job_queue_spec.rb[1:5:1] | passed | 0.01823 seconds |
60
- ./spec/approve/pending_job_queue_spec.rb[1:5:2] | passed | 0.01382 seconds |
61
- ./spec/approve/pending_job_queue_spec.rb[1:6:1] | passed | 0.00568 seconds |
62
- ./spec/approve/pending_job_queue_spec.rb[1:6:2] | passed | 0.01792 seconds |
63
- ./spec/approve/pending_job_queue_spec.rb[1:7:1] | passed | 0.0115 seconds |
64
- ./spec/approve/pending_job_queue_spec.rb[1:7:2] | passed | 0.01447 seconds |
65
- ./spec/approve/pending_job_queue_spec.rb[1:8:1] | passed | 0.01243 seconds |
66
- ./spec/approve/pending_job_queue_spec.rb[1:8:2] | passed | 0.01171 seconds |
67
- ./spec/approve/pending_job_queue_spec.rb[1:9:1] | passed | 0.05488 seconds |
68
- ./spec/approve/pending_job_queue_spec.rb[1:9:2] | passed | 0.03156 seconds |
69
- ./spec/approve/pending_job_queue_spec.rb[1:9:3] | passed | 0.03417 seconds |
70
- ./spec/approve/pending_job_queue_spec.rb[1:9:4] | passed | 0.03747 seconds |
71
- ./spec/approve/pending_job_queue_spec.rb[1:9:5] | passed | 0.03307 seconds |
72
- ./spec/approve/pending_job_queue_spec.rb[1:10:1] | passed | 0.5602 seconds |
73
- ./spec/approve/pending_job_queue_spec.rb[1:11:1] | passed | 0.02438 seconds |
74
- ./spec/approve/pending_job_queue_spec.rb[1:12:1] | passed | 0.01052 seconds |
75
- ./spec/approve/pending_job_queue_spec.rb[1:12:2] | passed | 0.00988 seconds |
76
- ./spec/approve/pending_job_queue_spec.rb[1:12:3] | passed | 0.00947 seconds |
77
- ./spec/approve/pending_job_spec.rb[1:1:1] | passed | 0.00472 seconds |
78
- ./spec/approve/pending_job_spec.rb[1:1:2] | passed | 0.00377 seconds |
79
- ./spec/approve/pending_job_spec.rb[1:1:3] | passed | 0.00224 seconds |
80
- ./spec/approve/pending_job_spec.rb[1:1:4] | passed | 0.00234 seconds |
81
- ./spec/approve/pending_job_spec.rb[1:1:5] | passed | 0.00158 seconds |
82
- ./spec/approve/pending_job_spec.rb[1:1:6] | passed | 0.00216 seconds |
83
- ./spec/approve/pending_job_spec.rb[1:1:7] | passed | 0.00177 seconds |
84
- ./spec/approve/pending_job_spec.rb[1:2:1] | passed | 0.00244 seconds |
85
- ./spec/approve/pending_job_spec.rb[1:2:2] | passed | 0.00095 seconds |
86
- ./spec/approve/pending_job_spec.rb[1:2:3] | passed | 0.00143 seconds |
87
- ./spec/approve/pending_job_spec.rb[1:2:4] | passed | 0.00126 seconds |
88
- ./spec/approve/pending_job_spec.rb[1:2:5] | passed | 0.00091 seconds |
89
- ./spec/approve/pending_job_spec.rb[1:3:1:1] | passed | 0.00249 seconds |
90
- ./spec/approve/pending_job_spec.rb[1:3:1:2] | passed | 0.0024 seconds |
91
- ./spec/approve/pending_job_spec.rb[1:3:1:3] | passed | 0.00217 seconds |
92
- ./spec/approve/pending_job_spec.rb[1:3:1:4] | passed | 0.0036 seconds |
93
- ./spec/approve/pending_job_spec.rb[1:3:1:5] | passed | 0.00262 seconds |
94
- ./spec/approve/pending_job_spec.rb[1:3:1:6] | passed | 0.00337 seconds |
95
- ./spec/approve/pending_job_spec.rb[1:3:1:7] | passed | 0.00259 seconds |
96
- ./spec/approve/pending_job_spec.rb[1:4:1:1] | passed | 0.0036 seconds |
97
- ./spec/approve/pending_job_spec.rb[1:4:1:2] | passed | 0.00381 seconds |
98
- ./spec/approve/pending_job_spec.rb[1:4:1:3] | passed | 0.00323 seconds |
99
- ./spec/approve/pending_job_spec.rb[1:4:1:4] | passed | 0.0035 seconds |
100
- ./spec/approve/pending_job_spec.rb[1:4:1:5] | passed | 0.00351 seconds |
101
- ./spec/approve/pending_job_spec.rb[1:4:1:6] | passed | 0.0049 seconds |
102
- ./spec/approve/pending_job_spec.rb[1:4:1:7] | passed | 0.00623 seconds |
103
- ./spec/approve/pending_job_spec.rb[1:5:1] | passed | 0.00209 seconds |
104
- ./spec/approve/pending_job_spec.rb[1:6:1] | passed | 0.00734 seconds |
105
- ./spec/approve/pending_job_spec.rb[1:7:1] | passed | 0.00295 seconds |
106
- ./spec/approve/pending_job_spec.rb[1:7:2] | passed | 0.00424 seconds |
107
- ./spec/approve/pending_job_spec.rb[1:7:3] | passed | 0.00436 seconds |
108
- ./spec/approve/pending_job_spec.rb[1:8:1] | passed | 0.00213 seconds |
109
- ./spec/approve/pending_job_spec.rb[1:8:2] | passed | 0.00182 seconds |
110
- ./spec/approve/pending_job_spec.rb[1:8:3] | passed | 0.00239 seconds |
111
- ./spec/approve/pending_job_spec.rb[1:8:4] | passed | 0.00229 seconds |
112
- ./spec/approve/pending_job_spec.rb[1:8:5] | passed | 0.00237 seconds |
113
- ./spec/approve_spec.rb[1:1] | passed | 0.00338 seconds |
114
- ./spec/approve_spec.rb[1:2] | passed | 0.00436 seconds |
115
- ./spec/approve_spec.rb[1:3] | passed | 0.55259 seconds |
116
- ./spec/approve_spec.rb[1:4] | passed | 0.00777 seconds |
117
- ./spec/approve_spec.rb[1:5] | passed | 0.00467 seconds |
118
- ./spec/approve_spec.rb[1:6:1] | passed | 0.00955 seconds |
119
- ./spec/approve_spec.rb[1:6:2] | passed | 0.01144 seconds |
120
- ./spec/approve_spec.rb[1:6:3] | passed | 0.51245 seconds |
121
- ./spec/approve_spec.rb[1:6:4] | passed | 0.01855 seconds |
122
- ./spec/approve_spec.rb[1:6:5] | passed | 0.01114 seconds |
123
- ./spec/approve_spec.rb[1:6:6] | unknown | |
124
- ./spec/approve_spec.rb[1:7:1] | passed | 0.0052 seconds |
125
- ./spec/approve_spec.rb[1:7:2] | passed | 0.01155 seconds |
126
- ./spec/approve_spec.rb[1:8:1] | passed | 0.00829 seconds |
127
- ./spec/approve_spec.rb[1:8:2] | passed | 0.01191 seconds |
128
- ./spec/server/public/approve.css_spec.rb[1:1] | passed | 0.00454 seconds |
129
- ./spec/server/views/approval_keys.erb_spec.rb[1:1:1] | passed | 0.01122 seconds |
130
- ./spec/server/views/approval_keys.erb_spec.rb[1:1:2] | passed | 0.01072 seconds |
131
- ./spec/server/views/approval_keys.erb_spec.rb[1:1:3] | passed | 0.01359 seconds |
132
- ./spec/server/views/approval_keys.erb_spec.rb[1:1:4] | passed | 0.01491 seconds |
133
- ./spec/server/views/approval_keys.erb_spec.rb[1:2] | passed | 0.02502 seconds |
134
- ./spec/server/views/approval_keys.erb_spec.rb[1:3] | passed | 0.02061 seconds |
135
- ./spec/server/views/job_details.erb_spec.rb[1:1] | passed | 0.00957 seconds |
136
- ./spec/server/views/job_details.erb_spec.rb[1:2] | passed | 0.0069 seconds |
137
- ./spec/server/views/job_details.erb_spec.rb[1:3] | passed | 0.00974 seconds |
138
- ./spec/server/views/job_details.erb_spec.rb[1:4] | passed | 0.01302 seconds |
139
- ./spec/server/views/job_details.erb_spec.rb[1:5] | passed | 0.00842 seconds |
140
- ./spec/server/views/job_details.erb_spec.rb[1:6] | passed | 0.00889 seconds |
141
- ./spec/server/views/job_list.erb_spec.rb[1:1:1] | passed | 0.02364 seconds |
142
- ./spec/server/views/job_list.erb_spec.rb[1:1:2] | passed | 0.00844 seconds |
143
- ./spec/server/views/job_list.erb_spec.rb[1:1:3] | passed | 0.02169 seconds |
144
- ./spec/server/views/job_list.erb_spec.rb[1:1:4] | passed | 0.01655 seconds |
145
- ./spec/server/views/job_list.erb_spec.rb[1:1:5] | passed | 0.01163 seconds |
146
- ./spec/server/views/job_list.erb_spec.rb[1:1:6] | passed | 0.01035 seconds |
147
- ./spec/server/views/job_list.erb_spec.rb[1:2] | passed | 0.02258 seconds |
148
- ./spec/server/views/job_list.erb_spec.rb[1:3] | passed | 0.02126 seconds |
149
- ./spec/server/views/job_list.erb_spec.rb[1:4] | passed | 0.55306 seconds |
1
+ example_id | status | run_time |
2
+ ---------------------------------------------------- | ------ | --------------- |
3
+ ./spec/approve/approval_key_list_spec.rb[1:1:1] | passed | 0.00453 seconds |
4
+ ./spec/approve/approval_key_list_spec.rb[1:1:2] | passed | 0.00234 seconds |
5
+ ./spec/approve/approval_key_list_spec.rb[1:1:3] | passed | 0.00593 seconds |
6
+ ./spec/approve/approval_key_list_spec.rb[1:2:1] | passed | 0.01656 seconds |
7
+ ./spec/approve/approval_key_list_spec.rb[1:2:2] | passed | 0.01564 seconds |
8
+ ./spec/approve/approval_key_list_spec.rb[1:3:1] | passed | 0.01701 seconds |
9
+ ./spec/approve/approval_key_list_spec.rb[1:3:2] | passed | 0.0138 seconds |
10
+ ./spec/approve/approval_key_list_spec.rb[1:4:1] | passed | 0.01947 seconds |
11
+ ./spec/approve/approval_key_list_spec.rb[1:4:2] | passed | 0.02472 seconds |
12
+ ./spec/approve/approval_key_list_spec.rb[1:4:3] | passed | 0.01904 seconds |
13
+ ./spec/approve/approval_key_list_spec.rb[1:5:1] | passed | 0.05037 seconds |
14
+ ./spec/approve/approval_key_list_spec.rb[1:5:2] | passed | 0.04353 seconds |
15
+ ./spec/approve/approval_key_list_spec.rb[1:5:3] | passed | 0.06019 seconds |
16
+ ./spec/approve/approval_key_list_spec.rb[1:6:1] | passed | 0.07289 seconds |
17
+ ./spec/approve/approval_key_list_spec.rb[1:6:2] | passed | 0.04092 seconds |
18
+ ./spec/approve/approval_key_list_spec.rb[1:6:3] | passed | 0.10827 seconds |
19
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:1] | passed | 0.40854 seconds |
20
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:2] | passed | 0.42336 seconds |
21
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:3] | passed | 0.41519 seconds |
22
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:4] | passed | 0.39611 seconds |
23
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:5] | passed | 0.38865 seconds |
24
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:6] | passed | 0.40623 seconds |
25
+ ./spec/approve/approval_key_list_spec.rb[1:7:1:1:7] | passed | 0.41431 seconds |
26
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:1] | passed | 0.42289 seconds |
27
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:2] | passed | 0.41745 seconds |
28
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:3] | passed | 0.40695 seconds |
29
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:4] | passed | 0.43214 seconds |
30
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:5] | passed | 0.41234 seconds |
31
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:6] | passed | 0.50559 seconds |
32
+ ./spec/approve/approval_key_list_spec.rb[1:7:2:1:7] | passed | 0.41778 seconds |
33
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:1] | passed | 0.44006 seconds |
34
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:2] | passed | 0.41725 seconds |
35
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:3] | passed | 0.41063 seconds |
36
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:4] | passed | 0.43307 seconds |
37
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:5] | passed | 0.4315 seconds |
38
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:6] | passed | 0.42041 seconds |
39
+ ./spec/approve/approval_key_list_spec.rb[1:7:3:1:7] | passed | 0.45198 seconds |
40
+ ./spec/approve/approval_key_list_spec.rb[1:8:1] | passed | 0.07438 seconds |
41
+ ./spec/approve/approval_key_list_spec.rb[1:9:1] | passed | 0.04127 seconds |
42
+ ./spec/approve/cleaner_spec.rb[1:1:1] | passed | 0.03321 seconds |
43
+ ./spec/approve/cleaner_spec.rb[1:1:2] | passed | 0.03301 seconds |
44
+ ./spec/approve/cleaner_spec.rb[1:1:3] | passed | 0.0624 seconds |
45
+ ./spec/approve/cleaner_spec.rb[1:2:1] | passed | 0.04943 seconds |
46
+ ./spec/approve/cleaner_spec.rb[1:2:2] | passed | 0.03647 seconds |
47
+ ./spec/approve/cleaner_spec.rb[1:3:1] | passed | 0.0301 seconds |
48
+ ./spec/approve/pending_job_queue_spec.rb[1:1:1] | passed | 0.03955 seconds |
49
+ ./spec/approve/pending_job_queue_spec.rb[1:1:2] | passed | 0.03376 seconds |
50
+ ./spec/approve/pending_job_queue_spec.rb[1:1:3] | passed | 0.02707 seconds |
51
+ ./spec/approve/pending_job_queue_spec.rb[1:1:4] | passed | 0.02877 seconds |
52
+ ./spec/approve/pending_job_queue_spec.rb[1:1:5:1] | passed | 0.03244 seconds |
53
+ ./spec/approve/pending_job_queue_spec.rb[1:2:1] | passed | 0.02465 seconds |
54
+ ./spec/approve/pending_job_queue_spec.rb[1:2:2] | passed | 0.01969 seconds |
55
+ ./spec/approve/pending_job_queue_spec.rb[1:3:1] | passed | 0.01656 seconds |
56
+ ./spec/approve/pending_job_queue_spec.rb[1:3:2] | passed | 0.02136 seconds |
57
+ ./spec/approve/pending_job_queue_spec.rb[1:4:1] | passed | 1.42 seconds |
58
+ ./spec/approve/pending_job_queue_spec.rb[1:4:2] | passed | 0.01356 seconds |
59
+ ./spec/approve/pending_job_queue_spec.rb[1:5:1] | passed | 0.03191 seconds |
60
+ ./spec/approve/pending_job_queue_spec.rb[1:5:2] | passed | 0.01995 seconds |
61
+ ./spec/approve/pending_job_queue_spec.rb[1:6:1] | passed | 0.04591 seconds |
62
+ ./spec/approve/pending_job_queue_spec.rb[1:6:2] | passed | 0.02469 seconds |
63
+ ./spec/approve/pending_job_queue_spec.rb[1:7:1] | passed | 0.0259 seconds |
64
+ ./spec/approve/pending_job_queue_spec.rb[1:7:2] | passed | 0.02409 seconds |
65
+ ./spec/approve/pending_job_queue_spec.rb[1:8:1] | passed | 0.04047 seconds |
66
+ ./spec/approve/pending_job_queue_spec.rb[1:8:2] | passed | 0.0442 seconds |
67
+ ./spec/approve/pending_job_queue_spec.rb[1:9:1] | passed | 0.02993 seconds |
68
+ ./spec/approve/pending_job_queue_spec.rb[1:9:2] | passed | 0.02353 seconds |
69
+ ./spec/approve/pending_job_queue_spec.rb[1:10:1] | passed | 0.02156 seconds |
70
+ ./spec/approve/pending_job_queue_spec.rb[1:10:2] | passed | 0.02894 seconds |
71
+ ./spec/approve/pending_job_queue_spec.rb[1:11:1] | passed | 0.11758 seconds |
72
+ ./spec/approve/pending_job_queue_spec.rb[1:11:2] | passed | 0.04655 seconds |
73
+ ./spec/approve/pending_job_queue_spec.rb[1:11:3] | passed | 0.04641 seconds |
74
+ ./spec/approve/pending_job_queue_spec.rb[1:11:4] | passed | 0.05952 seconds |
75
+ ./spec/approve/pending_job_queue_spec.rb[1:11:5] | passed | 0.08348 seconds |
76
+ ./spec/approve/pending_job_queue_spec.rb[1:12:1] | passed | 0.02473 seconds |
77
+ ./spec/approve/pending_job_queue_spec.rb[1:13:1] | passed | 0.0165 seconds |
78
+ ./spec/approve/pending_job_queue_spec.rb[1:14:1] | passed | 0.02205 seconds |
79
+ ./spec/approve/pending_job_queue_spec.rb[1:14:2] | passed | 0.02296 seconds |
80
+ ./spec/approve/pending_job_queue_spec.rb[1:14:3] | passed | 0.04434 seconds |
81
+ ./spec/approve/pending_job_queue_spec.rb[1:14:4] | passed | 0.0293 seconds |
82
+ ./spec/approve/pending_job_spec.rb[1:1:1] | passed | 0.0143 seconds |
83
+ ./spec/approve/pending_job_spec.rb[1:1:2] | passed | 0.01816 seconds |
84
+ ./spec/approve/pending_job_spec.rb[1:1:3] | passed | 0.01832 seconds |
85
+ ./spec/approve/pending_job_spec.rb[1:1:4] | passed | 0.00902 seconds |
86
+ ./spec/approve/pending_job_spec.rb[1:1:5] | passed | 0.01347 seconds |
87
+ ./spec/approve/pending_job_spec.rb[1:1:6] | passed | 0.01001 seconds |
88
+ ./spec/approve/pending_job_spec.rb[1:1:7] | passed | 0.05291 seconds |
89
+ ./spec/approve/pending_job_spec.rb[1:1:8] | passed | 0.01808 seconds |
90
+ ./spec/approve/pending_job_spec.rb[1:1:9] | passed | 0.01182 seconds |
91
+ ./spec/approve/pending_job_spec.rb[1:2:1] | passed | 0.01788 seconds |
92
+ ./spec/approve/pending_job_spec.rb[1:2:2] | passed | 0.00397 seconds |
93
+ ./spec/approve/pending_job_spec.rb[1:2:3] | passed | 0.00879 seconds |
94
+ ./spec/approve/pending_job_spec.rb[1:2:4] | passed | 0.0098 seconds |
95
+ ./spec/approve/pending_job_spec.rb[1:2:5] | passed | 0.00799 seconds |
96
+ ./spec/approve/pending_job_spec.rb[1:3:1:1] | passed | 0.01316 seconds |
97
+ ./spec/approve/pending_job_spec.rb[1:3:1:2] | passed | 0.01485 seconds |
98
+ ./spec/approve/pending_job_spec.rb[1:3:1:3] | passed | 0.01544 seconds |
99
+ ./spec/approve/pending_job_spec.rb[1:3:1:4] | passed | 0.01291 seconds |
100
+ ./spec/approve/pending_job_spec.rb[1:3:1:5] | passed | 0.01183 seconds |
101
+ ./spec/approve/pending_job_spec.rb[1:3:1:6] | passed | 0.01616 seconds |
102
+ ./spec/approve/pending_job_spec.rb[1:3:1:7] | passed | 0.01493 seconds |
103
+ ./spec/approve/pending_job_spec.rb[1:4:1:1] | passed | 0.01301 seconds |
104
+ ./spec/approve/pending_job_spec.rb[1:4:1:2] | passed | 0.01745 seconds |
105
+ ./spec/approve/pending_job_spec.rb[1:4:1:3] | passed | 0.02452 seconds |
106
+ ./spec/approve/pending_job_spec.rb[1:4:1:4] | passed | 0.01382 seconds |
107
+ ./spec/approve/pending_job_spec.rb[1:4:1:5] | passed | 0.01824 seconds |
108
+ ./spec/approve/pending_job_spec.rb[1:4:1:6] | passed | 0.01978 seconds |
109
+ ./spec/approve/pending_job_spec.rb[1:4:1:7] | passed | 0.0179 seconds |
110
+ ./spec/approve/pending_job_spec.rb[1:5:1] | passed | 0.01115 seconds |
111
+ ./spec/approve/pending_job_spec.rb[1:6:1] | passed | 0.06287 seconds |
112
+ ./spec/approve/pending_job_spec.rb[1:6:2] | passed | 0.01177 seconds |
113
+ ./spec/approve/pending_job_spec.rb[1:6:3:1] | passed | 0.01156 seconds |
114
+ ./spec/approve/pending_job_spec.rb[1:6:3:2] | passed | 0.02082 seconds |
115
+ ./spec/approve/pending_job_spec.rb[1:6:3:3] | passed | 0.04325 seconds |
116
+ ./spec/approve/pending_job_spec.rb[1:6:3:4] | passed | 0.03485 seconds |
117
+ ./spec/approve/pending_job_spec.rb[1:6:3:5] | passed | 0.02379 seconds |
118
+ ./spec/approve/pending_job_spec.rb[1:6:3:6] | passed | 0.03565 seconds |
119
+ ./spec/approve/pending_job_spec.rb[1:6:3:7] | passed | 0.01551 seconds |
120
+ ./spec/approve/pending_job_spec.rb[1:6:3:8] | passed | 0.04021 seconds |
121
+ ./spec/approve/pending_job_spec.rb[1:6:3:9] | passed | 0.01262 seconds |
122
+ ./spec/approve/pending_job_spec.rb[1:6:3:10] | passed | 0.01346 seconds |
123
+ ./spec/approve/pending_job_spec.rb[1:6:3:11] | passed | 0.00692 seconds |
124
+ ./spec/approve/pending_job_spec.rb[1:7:1] | passed | 0.0112 seconds |
125
+ ./spec/approve/pending_job_spec.rb[1:7:2] | passed | 0.02206 seconds |
126
+ ./spec/approve/pending_job_spec.rb[1:7:3] | passed | 0.01299 seconds |
127
+ ./spec/approve/pending_job_spec.rb[1:8:1] | passed | 0.01077 seconds |
128
+ ./spec/approve/pending_job_spec.rb[1:8:2] | passed | 0.01097 seconds |
129
+ ./spec/approve/pending_job_spec.rb[1:8:3] | passed | 0.01448 seconds |
130
+ ./spec/approve/pending_job_spec.rb[1:8:4] | passed | 0.01549 seconds |
131
+ ./spec/approve/pending_job_spec.rb[1:8:5] | passed | 0.02272 seconds |
132
+ ./spec/approve/pending_job_spec.rb[1:9:1] | passed | 0.00213 seconds |
133
+ ./spec/approve/pending_job_spec.rb[1:9:2:1] | passed | 0.00558 seconds |
134
+ ./spec/approve/pending_job_spec.rb[1:10:1:1] | passed | 0.0122 seconds |
135
+ ./spec/approve/pending_job_spec.rb[1:11:1] | passed | 0.01485 seconds |
136
+ ./spec/approve/pending_job_spec.rb[1:11:2:1] | passed | 0.0134 seconds |
137
+ ./spec/approve_spec.rb[1:1] | passed | 0.00189 seconds |
138
+ ./spec/approve_spec.rb[1:2] | passed | 0.00193 seconds |
139
+ ./spec/approve_spec.rb[1:3] | passed | 0.00441 seconds |
140
+ ./spec/approve_spec.rb[1:4] | passed | 0.0155 seconds |
141
+ ./spec/approve_spec.rb[1:5] | passed | 0.00512 seconds |
142
+ ./spec/approve_spec.rb[1:6] | passed | 0.01601 seconds |
143
+ ./spec/approve_spec.rb[1:7] | passed | 0.01424 seconds |
144
+ ./spec/approve_spec.rb[1:8:1] | passed | 0.02502 seconds |
145
+ ./spec/approve_spec.rb[1:8:2] | passed | 0.02874 seconds |
146
+ ./spec/approve_spec.rb[1:8:3] | passed | 0.03407 seconds |
147
+ ./spec/approve_spec.rb[1:8:4] | passed | 0.04391 seconds |
148
+ ./spec/approve_spec.rb[1:8:5] | passed | 0.02847 seconds |
149
+ ./spec/approve_spec.rb[1:8:6] | passed | 0.03736 seconds |
150
+ ./spec/approve_spec.rb[1:9:1] | passed | 0.01789 seconds |
151
+ ./spec/approve_spec.rb[1:9:2] | passed | 0.0243 seconds |
152
+ ./spec/approve_spec.rb[1:10:1] | passed | 0.02163 seconds |
153
+ ./spec/approve_spec.rb[1:10:2] | passed | 0.02966 seconds |
154
+ ./spec/approve_spec.rb[1:11:1] | passed | 0.00674 seconds |
155
+ ./spec/approve_spec.rb[1:11:2] | passed | 0.0075 seconds |
156
+ ./spec/approve_spec.rb[1:11:3] | passed | 0.0079 seconds |
157
+ ./spec/approve_spec.rb[1:11:4] | passed | 0.00274 seconds |
158
+ ./spec/approve_spec.rb[1:11:5] | passed | 0.00359 seconds |
159
+ ./spec/server/public/approve.css_spec.rb[1:1] | passed | 0.01314 seconds |
160
+ ./spec/server/views/approval_keys.erb_spec.rb[1:1:1] | passed | 0.03024 seconds |
161
+ ./spec/server/views/approval_keys.erb_spec.rb[1:1:2] | passed | 0.02689 seconds |
162
+ ./spec/server/views/approval_keys.erb_spec.rb[1:1:3] | passed | 0.03696 seconds |
163
+ ./spec/server/views/approval_keys.erb_spec.rb[1:1:4] | passed | 0.02844 seconds |
164
+ ./spec/server/views/approval_keys.erb_spec.rb[1:2] | passed | 0.066 seconds |
165
+ ./spec/server/views/approval_keys.erb_spec.rb[1:3] | passed | 0.0256 seconds |
166
+ ./spec/server/views/job_details.erb_spec.rb[1:1] | passed | 0.01485 seconds |
167
+ ./spec/server/views/job_details.erb_spec.rb[1:2] | passed | 0.02209 seconds |
168
+ ./spec/server/views/job_details.erb_spec.rb[1:3] | passed | 0.0271 seconds |
169
+ ./spec/server/views/job_details.erb_spec.rb[1:4] | passed | 0.0467 seconds |
170
+ ./spec/server/views/job_details.erb_spec.rb[1:5] | passed | 0.02121 seconds |
171
+ ./spec/server/views/job_details.erb_spec.rb[1:6] | passed | 0.02237 seconds |
172
+ ./spec/server/views/job_list.erb_spec.rb[1:1:1] | passed | 0.02451 seconds |
173
+ ./spec/server/views/job_list.erb_spec.rb[1:1:2] | passed | 0.02167 seconds |
174
+ ./spec/server/views/job_list.erb_spec.rb[1:1:3] | passed | 0.03131 seconds |
175
+ ./spec/server/views/job_list.erb_spec.rb[1:1:4] | passed | 0.04476 seconds |
176
+ ./spec/server/views/job_list.erb_spec.rb[1:1:5] | passed | 0.03134 seconds |
177
+ ./spec/server/views/job_list.erb_spec.rb[1:1:6] | passed | 0.02926 seconds |
178
+ ./spec/server/views/job_list.erb_spec.rb[1:1:7] | passed | 0.02736 seconds |
179
+ ./spec/server/views/job_list.erb_spec.rb[1:2] | passed | 0.04678 seconds |
180
+ ./spec/server/views/job_list.erb_spec.rb[1:3] | passed | 0.05057 seconds |
181
+ ./spec/server/views/job_list.erb_spec.rb[1:4] | passed | 0.03516 seconds |
@@ -41,6 +41,16 @@ RSpec.describe "approval_keys.erb" do
41
41
  expect(Resque).not_to have_received(:enqueue_to)
42
42
  end
43
43
 
44
+ it "should respond to /approve/reset_running" do
45
+ expect(queue).to receive(:reset_running).and_call_original
46
+
47
+ post "/approve/reset_running?#{{ approval_key: key }.to_param}"
48
+
49
+ expect(last_response).to be_redirect
50
+ expect(last_response.header["Location"]).to match(%r{approve/job_list\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}$})
51
+ expect(Resque).not_to have_received(:enqueue_to)
52
+ end
53
+
44
54
  it "should respond to /approve/delete_one_queue" do
45
55
  expect(queue).to receive(:remove_one).and_call_original
46
56
 
@@ -101,6 +111,7 @@ RSpec.describe "approval_keys.erb" do
101
111
 
102
112
  expect(last_response.body).to match %r{Approval Keys(\n *)?</a>}
103
113
 
114
+ expect(last_response.body).to match %r{action="/approve/reset_running\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
104
115
  expect(last_response.body).to match %r{action="/approve/delete_queue\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
105
116
  expect(last_response.body).to match %r{action="/approve/delete_one_queue\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
106
117
  expect(last_response.body).to match %r{action="/approve/approve_queue\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
@@ -128,6 +139,7 @@ RSpec.describe "approval_keys.erb" do
128
139
 
129
140
  expect(last_response.body).to match %r{Approval Keys(\n *)?</a>}
130
141
 
142
+ expect(last_response.body).to match %r{action="/approve/reset_running\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
131
143
  expect(last_response.body).to match %r{action="/approve/delete_queue\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
132
144
  expect(last_response.body).to match %r{action="/approve/delete_one_queue\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
133
145
  expect(last_response.body).to match %r{action="/approve/approve_queue\?#{{ approval_key: key }.to_param.gsub("+", "\\\\+")}"}
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DefaultApprovalQueue < BasicJob
4
+ self.default_queue_name = "Default Approval Queue"
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MaxActiveJob < BasicJob
4
+ self.max_active_jobs = 10
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-approve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - RealNobody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rack-test
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: resque-scheduler
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +126,16 @@ dependencies:
140
126
  name: rspec-rails
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - ">="
129
+ - - ">"
144
130
  - !ruby/object:Gem::Version
145
- version: '0'
131
+ version: 3.9.1
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - ">="
136
+ - - ">"
151
137
  - !ruby/object:Gem::Version
152
- version: '0'
138
+ version: 3.9.1
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rubocop
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -182,16 +168,16 @@ dependencies:
182
168
  name: sinatra
183
169
  requirement: !ruby/object:Gem::Requirement
184
170
  requirements:
185
- - - "~>"
171
+ - - ">="
186
172
  - !ruby/object:Gem::Version
187
- version: '1.4'
173
+ version: '0'
188
174
  type: :development
189
175
  prerelease: false
190
176
  version_requirements: !ruby/object:Gem::Requirement
191
177
  requirements:
192
- - - "~>"
178
+ - - ">="
193
179
  - !ruby/object:Gem::Version
194
- version: '1.4'
180
+ version: '0'
195
181
  - !ruby/object:Gem::Dependency
196
182
  name: timecop
197
183
  requirement: !ruby/object:Gem::Requirement
@@ -219,6 +205,7 @@ files:
219
205
  - lib/resque/approve_server.rb
220
206
  - lib/resque/plugins/approve.rb
221
207
  - lib/resque/plugins/approve/approval_key_list.rb
208
+ - lib/resque/plugins/approve/auto_approve_next.rb
222
209
  - lib/resque/plugins/approve/cleaner.rb
223
210
  - lib/resque/plugins/approve/pending_job.rb
224
211
  - lib/resque/plugins/approve/pending_job_queue.rb
@@ -248,6 +235,8 @@ files:
248
235
  - spec/support/config/redis-auth.yml
249
236
  - spec/support/jobs/01_basic_job.rb
250
237
  - spec/support/jobs/auto_delete_approval_key_job.rb
238
+ - spec/support/jobs/default_approval_queue_job.rb
239
+ - spec/support/jobs/max_active_job.rb
251
240
  - spec/support/purge_all.rb
252
241
  homepage: https://github.com/RealNobody
253
242
  licenses:
@@ -268,8 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
257
  - !ruby/object:Gem::Version
269
258
  version: '0'
270
259
  requirements: []
271
- rubyforge_project:
272
- rubygems_version: 2.5.1
260
+ rubygems_version: 3.0.3
273
261
  signing_key:
274
262
  specification_version: 4
275
263
  summary: Keeps a list of jobs which require approval to run.
@@ -288,5 +276,7 @@ test_files:
288
276
  - spec/support/config/redis-auth.yml
289
277
  - spec/support/jobs/01_basic_job.rb
290
278
  - spec/support/jobs/auto_delete_approval_key_job.rb
279
+ - spec/support/jobs/max_active_job.rb
280
+ - spec/support/jobs/default_approval_queue_job.rb
291
281
  - spec/support/purge_all.rb
292
282
  - spec/rails_helper.rb