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.
- checksums.yaml +5 -5
- data/lib/resque-approve.rb +1 -0
- data/lib/resque/approve_server.rb +12 -1
- data/lib/resque/plugins/approve.rb +45 -1
- data/lib/resque/plugins/approve/approval_key_list.rb +1 -1
- data/lib/resque/plugins/approve/auto_approve_next.rb +38 -0
- data/lib/resque/plugins/approve/pending_job.rb +94 -28
- data/lib/resque/plugins/approve/pending_job_queue.rb +31 -1
- data/lib/resque/plugins/version.rb +1 -1
- data/lib/resque/server/views/_approval_key_rows.erb +4 -1
- data/lib/resque/server/views/approval_keys.erb +6 -0
- data/lib/resque/server/views/job_details.erb +3 -0
- data/lib/resque/server/views/job_list.erb +27 -13
- data/spec/approve/pending_job_queue_spec.rb +80 -2
- data/spec/approve/pending_job_spec.rb +222 -6
- data/spec/approve_spec.rb +53 -0
- data/spec/examples.txt +181 -149
- data/spec/server/views/job_list.erb_spec.rb +12 -0
- data/spec/support/jobs/default_approval_queue_job.rb +5 -0
- data/spec/support/jobs/max_active_job.rb +5 -0
- metadata +16 -26
data/spec/approve_spec.rb
CHANGED
@@ -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
|
data/spec/examples.txt
CHANGED
@@ -1,149 +1,181 @@
|
|
1
|
-
example_id | status
|
2
|
-
---------------------------------------------------- |
|
3
|
-
./spec/approve/approval_key_list_spec.rb[1:1:1] | passed
|
4
|
-
./spec/approve/approval_key_list_spec.rb[1:1:2] | passed
|
5
|
-
./spec/approve/approval_key_list_spec.rb[1:1:3] | passed
|
6
|
-
./spec/approve/approval_key_list_spec.rb[1:2:1] | passed
|
7
|
-
./spec/approve/approval_key_list_spec.rb[1:2:2] | passed
|
8
|
-
./spec/approve/approval_key_list_spec.rb[1:3:1] | passed
|
9
|
-
./spec/approve/approval_key_list_spec.rb[1:3:2] | passed
|
10
|
-
./spec/approve/approval_key_list_spec.rb[1:4:1] | passed
|
11
|
-
./spec/approve/approval_key_list_spec.rb[1:4:2] | passed
|
12
|
-
./spec/approve/approval_key_list_spec.rb[1:4:3] | passed
|
13
|
-
./spec/approve/approval_key_list_spec.rb[1:5:1] | passed
|
14
|
-
./spec/approve/approval_key_list_spec.rb[1:5:2] | passed
|
15
|
-
./spec/approve/approval_key_list_spec.rb[1:5:3] | passed
|
16
|
-
./spec/approve/approval_key_list_spec.rb[1:6:1] | passed
|
17
|
-
./spec/approve/approval_key_list_spec.rb[1:6:2] | passed
|
18
|
-
./spec/approve/approval_key_list_spec.rb[1:6:3] | passed
|
19
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:1] | passed
|
20
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:2] | passed
|
21
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:3] | passed
|
22
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:4] | passed
|
23
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:5] | passed
|
24
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:6] | passed
|
25
|
-
./spec/approve/approval_key_list_spec.rb[1:7:1:1:7] | passed
|
26
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:1] | passed
|
27
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:2] | passed
|
28
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:3] | passed
|
29
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:4] | passed
|
30
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:5] | passed
|
31
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:6] | passed
|
32
|
-
./spec/approve/approval_key_list_spec.rb[1:7:2:1:7] | passed
|
33
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:1] | passed
|
34
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:2] | passed
|
35
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:3] | passed
|
36
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:4] | passed
|
37
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:5] | passed
|
38
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:6] | passed
|
39
|
-
./spec/approve/approval_key_list_spec.rb[1:7:3:1:7] | passed
|
40
|
-
./spec/approve/approval_key_list_spec.rb[1:8:1] | passed
|
41
|
-
./spec/approve/approval_key_list_spec.rb[1:9:1] | passed
|
42
|
-
./spec/approve/cleaner_spec.rb[1:1:1] | passed
|
43
|
-
./spec/approve/cleaner_spec.rb[1:1:2] | passed
|
44
|
-
./spec/approve/cleaner_spec.rb[1:1:3] | passed
|
45
|
-
./spec/approve/cleaner_spec.rb[1:2:1] | passed
|
46
|
-
./spec/approve/cleaner_spec.rb[1:2:2] | passed
|
47
|
-
./spec/approve/cleaner_spec.rb[1:3:1] | passed
|
48
|
-
./spec/approve/pending_job_queue_spec.rb[1:1:1] | passed
|
49
|
-
./spec/approve/pending_job_queue_spec.rb[1:1:2] | passed
|
50
|
-
./spec/approve/pending_job_queue_spec.rb[1:1:3] | passed
|
51
|
-
./spec/approve/pending_job_queue_spec.rb[1:1:4] | passed
|
52
|
-
./spec/approve/pending_job_queue_spec.rb[1:1:5:1] | passed
|
53
|
-
./spec/approve/pending_job_queue_spec.rb[1:2:1] | passed
|
54
|
-
./spec/approve/pending_job_queue_spec.rb[1:2:2] | passed
|
55
|
-
./spec/approve/pending_job_queue_spec.rb[1:3:1] | passed
|
56
|
-
./spec/approve/pending_job_queue_spec.rb[1:3:2] | passed
|
57
|
-
./spec/approve/pending_job_queue_spec.rb[1:4:1] | passed
|
58
|
-
./spec/approve/pending_job_queue_spec.rb[1:4:2] | passed
|
59
|
-
./spec/approve/pending_job_queue_spec.rb[1:5:1] | passed
|
60
|
-
./spec/approve/pending_job_queue_spec.rb[1:5:2] | passed
|
61
|
-
./spec/approve/pending_job_queue_spec.rb[1:6:1] | passed
|
62
|
-
./spec/approve/pending_job_queue_spec.rb[1:6:2] | passed
|
63
|
-
./spec/approve/pending_job_queue_spec.rb[1:7:1] | passed
|
64
|
-
./spec/approve/pending_job_queue_spec.rb[1:7:2] | passed
|
65
|
-
./spec/approve/pending_job_queue_spec.rb[1:8:1] | passed
|
66
|
-
./spec/approve/pending_job_queue_spec.rb[1:8:2] | passed
|
67
|
-
./spec/approve/pending_job_queue_spec.rb[1:9:1] | passed
|
68
|
-
./spec/approve/pending_job_queue_spec.rb[1:9:2] | passed
|
69
|
-
./spec/approve/pending_job_queue_spec.rb[1:
|
70
|
-
./spec/approve/pending_job_queue_spec.rb[1:
|
71
|
-
./spec/approve/pending_job_queue_spec.rb[1:
|
72
|
-
./spec/approve/pending_job_queue_spec.rb[1:
|
73
|
-
./spec/approve/pending_job_queue_spec.rb[1:11:
|
74
|
-
./spec/approve/pending_job_queue_spec.rb[1:
|
75
|
-
./spec/approve/pending_job_queue_spec.rb[1:
|
76
|
-
./spec/approve/pending_job_queue_spec.rb[1:12:
|
77
|
-
./spec/approve/
|
78
|
-
./spec/approve/
|
79
|
-
./spec/approve/
|
80
|
-
./spec/approve/
|
81
|
-
./spec/approve/
|
82
|
-
./spec/approve/pending_job_spec.rb[1:1:
|
83
|
-
./spec/approve/pending_job_spec.rb[1:1:
|
84
|
-
./spec/approve/pending_job_spec.rb[1:
|
85
|
-
./spec/approve/pending_job_spec.rb[1:
|
86
|
-
./spec/approve/pending_job_spec.rb[1:
|
87
|
-
./spec/approve/pending_job_spec.rb[1:
|
88
|
-
./spec/approve/pending_job_spec.rb[1:
|
89
|
-
./spec/approve/pending_job_spec.rb[1:
|
90
|
-
./spec/approve/pending_job_spec.rb[1:
|
91
|
-
./spec/approve/pending_job_spec.rb[1:
|
92
|
-
./spec/approve/pending_job_spec.rb[1:
|
93
|
-
./spec/approve/pending_job_spec.rb[1:3
|
94
|
-
./spec/approve/pending_job_spec.rb[1:
|
95
|
-
./spec/approve/pending_job_spec.rb[1:
|
96
|
-
./spec/approve/pending_job_spec.rb[1:
|
97
|
-
./spec/approve/pending_job_spec.rb[1:
|
98
|
-
./spec/approve/pending_job_spec.rb[1:
|
99
|
-
./spec/approve/pending_job_spec.rb[1:
|
100
|
-
./spec/approve/pending_job_spec.rb[1:
|
101
|
-
./spec/approve/pending_job_spec.rb[1:
|
102
|
-
./spec/approve/pending_job_spec.rb[1:
|
103
|
-
./spec/approve/pending_job_spec.rb[1:
|
104
|
-
./spec/approve/pending_job_spec.rb[1:
|
105
|
-
./spec/approve/pending_job_spec.rb[1:
|
106
|
-
./spec/approve/pending_job_spec.rb[1:
|
107
|
-
./spec/approve/pending_job_spec.rb[1:
|
108
|
-
./spec/approve/pending_job_spec.rb[1:
|
109
|
-
./spec/approve/pending_job_spec.rb[1:
|
110
|
-
./spec/approve/pending_job_spec.rb[1:
|
111
|
-
./spec/approve/pending_job_spec.rb[1:
|
112
|
-
./spec/approve/pending_job_spec.rb[1:
|
113
|
-
./spec/
|
114
|
-
./spec/
|
115
|
-
./spec/
|
116
|
-
./spec/
|
117
|
-
./spec/
|
118
|
-
./spec/
|
119
|
-
./spec/
|
120
|
-
./spec/
|
121
|
-
./spec/
|
122
|
-
./spec/
|
123
|
-
./spec/
|
124
|
-
./spec/
|
125
|
-
./spec/
|
126
|
-
./spec/
|
127
|
-
./spec/
|
128
|
-
./spec/
|
129
|
-
./spec/
|
130
|
-
./spec/
|
131
|
-
./spec/
|
132
|
-
./spec/
|
133
|
-
./spec/
|
134
|
-
./spec/
|
135
|
-
./spec/
|
136
|
-
./spec/
|
137
|
-
./spec/
|
138
|
-
./spec/
|
139
|
-
./spec/
|
140
|
-
./spec/
|
141
|
-
./spec/
|
142
|
-
./spec/
|
143
|
-
./spec/
|
144
|
-
./spec/
|
145
|
-
./spec/
|
146
|
-
./spec/
|
147
|
-
./spec/
|
148
|
-
./spec/
|
149
|
-
./spec/
|
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("+", "\\\\+")}"}
|
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
|
+
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:
|
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:
|
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:
|
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: '
|
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: '
|
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
|
-
|
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
|