reactor 0.9.8 → 0.9.9

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: b88a2972562c084bbef1c2bd49ef8b99f0ddd0ee
4
- data.tar.gz: 1a4df6aae6d77e8de555d84d14fe0c0ffc62b576
3
+ metadata.gz: 79a37d4373106a9ecf4726ae5c5cdc144731eb62
4
+ data.tar.gz: 9c517481d516795077a95cf778e5a227e39a0549
5
5
  SHA512:
6
- metadata.gz: 30bdb47fd98c732c77ac7e621bdcfb591b7e5c85ce3e23d0ff6a1a3bc71f21e38ed499c8bb98867b6dcf709611b08e30f7e1f067be0c7cd159252f7973fc1177
7
- data.tar.gz: 8a6256316e599447dc6646cb4d8e7cab9deb8a2cda6591bdb58129b4672bfbab34b8b83112c354a23f12a2dc6451480afcc08ed20850ba56e29cc44830e7597d
6
+ metadata.gz: 49ff1b050b0eb88a050545a2b4a0796bf1ee26565e53ee6c503700226588b4d84e503adde531f46d9bb3ccc9072f72d1c083a335a7056e93ed33e48b8dcd2904
7
+ data.tar.gz: cc0ef56ff6fd82481a5dfce05fb4788b1255fcadc4f7a347ea57ff8b11fd10a36f1ece66484f45b2c1a72c12a17bac143619e2a784afa1fa6af7982c87e127e8
@@ -60,6 +60,6 @@ module Reactor::Publishable
60
60
  actor: (signature[:actor] ? send(signature[:actor]) : self),
61
61
  target: (signature[:target] ? self : nil),
62
62
  at: (signature[:at] ? send(signature[:at]) : nil)
63
- ).except(:watch, :if)
63
+ ).except(:watch)
64
64
  end
65
65
  end
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.9.8"
2
+ VERSION = "0.9.9"
3
3
  end
@@ -118,6 +118,32 @@ describe Reactor::Publishable do
118
118
 
119
119
  expect{ Reactor::Event.perform(@job_args[0], @job_args[1]) }.to_not change{ Sidekiq::Extensions::DelayedClass.jobs.size }
120
120
  end
121
+
122
+ it 'keeps the if intact when rescheduling' do
123
+ old_start_at = auction.start_at
124
+ auction.start_at = 3.day.from_now
125
+ allow(Reactor::Event).to receive(:publish)
126
+ expect(Reactor::Event).to receive(:publish).with(:conditional_event_on_save, {
127
+ at: auction.start_at,
128
+ actor: auction,
129
+ target: nil,
130
+ was: old_start_at,
131
+ if: anything
132
+ })
133
+ auction.save!
134
+ end
135
+
136
+ it 'keeps the if intact when scheduling' do
137
+ start_at = 3.days.from_now
138
+ allow(Reactor::Event).to receive(:publish)
139
+ expect(Reactor::Event).to receive(:publish).with(:conditional_event_on_save, {
140
+ at: start_at,
141
+ actor: anything,
142
+ target: nil,
143
+ if: anything
144
+ })
145
+ Auction.create!(start_at: start_at)
146
+ end
121
147
  end
122
148
 
123
149
  it 'supports immediate events (on create) that get fired once' do
@@ -18,13 +18,13 @@ class Auction < ActiveRecord::Base
18
18
  end
19
19
 
20
20
  def self.ring_bell(event)
21
- pp "ring ring! #{event}"
21
+ "ring ring! #{event}"
22
22
  end
23
23
  end
24
24
 
25
25
  Reactor.in_test_mode do
26
26
  class TestModeAuction < ActiveRecord::Base
27
- on_event :test_puppy_delivered, -> (event) { pp "success" }
27
+ on_event :test_puppy_delivered, -> (event) { "success" }
28
28
  end
29
29
  end
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - winfred
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-04-10 00:00:00.000000000 Z
14
+ date: 2015-11-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sidekiq
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  version: '0'
217
217
  requirements: []
218
218
  rubyforge_project:
219
- rubygems_version: 2.4.6
219
+ rubygems_version: 2.4.5.1
220
220
  signing_key:
221
221
  specification_version: 4
222
222
  summary: Sidekiq/ActiveRecord pubsub lib