triggerable 0.1.12 → 0.1.13
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae7a6d0914d86abf6eefa16067fcc087d7d006f
|
4
|
+
data.tar.gz: 5b8690f8b3c063a708f23b03037f787ce7bdf943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4133d5659157bad890dd95058b9b7da45749b6f125fb3f90f8395734f551fa1d9fa0fa89092367a47c41186a16f9c7c362312b1d331788695998655142df4853
|
7
|
+
data.tar.gz: 069cebeb6b6166db4fb38600b6391c7cdacdbef4433d962db8d3755034c015943073e30aa481d922c591c7986d25ff767d8387fa1d3e851d5b6456d0e38f7c66
|
data/lib/triggerable/version.rb
CHANGED
@@ -29,6 +29,28 @@ describe 'Automations' do
|
|
29
29
|
expect(TestTask.all.last.kind).to eq('follow up')
|
30
30
|
end
|
31
31
|
|
32
|
+
it 'before+not_in' do
|
33
|
+
constantize_time_now Time.utc 2012, 9, 1, 12, 00
|
34
|
+
|
35
|
+
TestTask.automation if: {and: [{scheduled_at: {before: 2.hours}}, {status: {not_in: [:solved, :completed]}}]} do
|
36
|
+
TestTask.create kind: 'follow up'
|
37
|
+
end
|
38
|
+
|
39
|
+
task = TestTask.create scheduled_at: Time.utc(2012, 9, 1, 20, 00)
|
40
|
+
expect(TestTask.count).to eq(1)
|
41
|
+
task.update_attributes status: 'open', kind: 'service'
|
42
|
+
expect(TestTask.count).to eq(1)
|
43
|
+
|
44
|
+
constantize_time_now Time.utc 2012, 9, 1, 15, 00
|
45
|
+
Triggerable::Engine.run_automations(1.hour)
|
46
|
+
expect(TestTask.count).to eq(1)
|
47
|
+
|
48
|
+
constantize_time_now Time.utc 2012, 9, 1, 18, 00
|
49
|
+
Triggerable::Engine.run_automations(1.hour)
|
50
|
+
expect(TestTask.count).to eq(2)
|
51
|
+
expect(TestTask.all.last.kind).to eq('follow up')
|
52
|
+
end
|
53
|
+
|
32
54
|
it 'before' do
|
33
55
|
constantize_time_now Time.utc 2012, 9, 1, 12, 00
|
34
56
|
|