Sha256: b4048f4cfc772e615c2b5767cd29d18de448eea0e6c8a2ffb33d1e17d2b9dfa3

Contents?: true

Size: 459 Bytes

Versions: 1

Compression:

Stored size: 459 Bytes

Contents

require 'spec_helper'


class Auction < ActiveRecord::Base
  on_event :bid_made do |event|
    event.target.update_column :status, 'first_bid_made'
  end
end

describe Reactor::Subscribable do

  describe 'subscribes_to' do
    it 'binds block of code statically to event being fired' do
      Auction.any_instance.should_receive(:update_column).with(:status, 'first_bid_made')
      Reactor::Event.publish(:bid_made, target: Auction.create)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reactor-0.3.1 spec/models/concerns/subscribable_spec.rb