spec/adhearsion/punchblock_plugin/initializer_spec.rb in adhearsion-2.0.0.rc3 vs spec/adhearsion/punchblock_plugin/initializer_spec.rb in adhearsion-2.0.0.rc4
- old
+ new
@@ -50,11 +50,11 @@
flexmock Adhearsion::Process, :fqdn => 'hostname'
flexmock ::Process, :pid => 1234
end
let(:call_id) { rand }
- let(:offer) { ::Punchblock::Event::Offer.new.tap { |o| o.call_id = call_id } }
+ let(:offer) { ::Punchblock::Event::Offer.new.tap { |o| o.target_call_id = call_id } }
let(:mock_call) { flexmock('Call', :id => call_id).tap { |call| call.should_ignore_missing } }
describe "starts the client with the default values" do
subject { initialize_punchblock }
@@ -243,11 +243,11 @@
after { Events.trigger_immediately :punchblock, offer }
end
describe "dispatching a component event" do
let(:component) { flexmock 'ComponentNode' }
- let(:mock_event) { flexmock 'Event', :call_id => call_id, :source => component }
+ let(:mock_event) { flexmock 'Event', :target_call_id => call_id, :source => component }
before do
initialize_punchblock
end
@@ -256,11 +256,11 @@
Events.trigger_immediately :punchblock, mock_event
end
end
describe "dispatching a call event" do
- let(:mock_event) { flexmock 'Event', :call_id => call_id }
+ let(:mock_event) { flexmock 'Event', :target_call_id => call_id }
describe "with an active call" do
before do
initialize_punchblock
Adhearsion.active_calls << mock_call
@@ -271,10 +271,10 @@
Initializer.dispatch_call_event mock_event
end
end
describe "with an inactive call" do
- let(:mock_event) { flexmock 'Event', :call_id => call_id }
+ let(:mock_event) { flexmock 'Event', :target_call_id => call_id }
it "should log an error" do
flexmock(Adhearsion::Logging.get_logger(Initializer)).should_receive(:error).once.with("Event received for inactive call #{call_id}: #{mock_event.inspect}")
Initializer.dispatch_call_event mock_event
end