spec/punchblock/component/tropo/transfer_spec.rb in punchblock-0.4.3 vs spec/punchblock/component/tropo/transfer_spec.rb in punchblock-0.5.0
- old
+ new
@@ -30,16 +30,17 @@
it_should_behave_like 'command_headers'
end
describe "actions" do
+ let(:mock_client) { mock 'Client' }
let(:command) { Transfer.new :to => 'tel:+14045551212', :from => 'tel:+14155551212' }
before do
command.component_id = 'abc123'
command.call_id = '123abc'
- command.connection = Connection.new :username => '123', :password => '123'
+ command.client = mock_client
end
describe '#stop_action' do
subject { command.stop_action }
@@ -54,10 +55,10 @@
command.request!
command.execute!
end
it "should send its command properly" do
- Connection.any_instance.expects(:write).with('123abc', command.stop_action, 'abc123')
+ mock_client.expects(:execute_command).with(command.stop_action, :call_id => '123abc', :component_id => 'abc123')
command.stop!
end
end
describe "when the command is not executing" do