spec/punchblock/component/input_spec.rb in punchblock-0.4.3 vs spec/punchblock/component/input_spec.rb in punchblock-0.5.0
- old
+ new
@@ -90,16 +90,17 @@
end
end
end
describe "actions" do
+ let(:mock_client) { mock 'Client' }
let(:command) { Input.new :grammar => '[5 DIGITS]' }
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 }
@@ -114,10 +115,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