spec/models/concerns/subscribable_spec.rb in reactor-0.11.1 vs spec/models/concerns/subscribable_spec.rb in reactor-0.11.2
- old
+ new
@@ -49,9 +49,15 @@
it 'binds block of code statically to event being fired' do
expect_any_instance_of(Auction).to receive(:update_column).with(:status, 'first_bid_made')
Reactor::Event.publish(:bid_made, target: Auction.create!(start_at: 10.minutes.from_now))
end
+ it 'protects against bad unicode characters in event attributes' do
+ expect {
+ Reactor::Event.publish(:bad_unicode, thing_one: "\xAD", thing_two: "\xAB" )
+ }.to_not raise_error
+ end
+
describe 'building uniquely named subscriber handler classes' do
it 'adds a static subscriber to the global lookup constant' do
expect(Reactor::SUBSCRIBERS['puppy_delivered'][0]).to eq(Reactor::StaticSubscribers::Auction::PuppyDeliveredHandler)
expect(Reactor::SUBSCRIBERS['puppy_delivered'][1]).to eq(Reactor::StaticSubscribers::Auction::DoNothingHandler)
end