spec/punchblock/component/tropo/ask_spec.rb in punchblock-0.4.3 vs spec/punchblock/component/tropo/ask_spec.rb in punchblock-0.5.0
- old
+ new
@@ -84,16 +84,17 @@
end
end
end
describe "actions" do
+ let(:mock_client) { mock 'Client' }
let(:command) { Ask.new :choices => '[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 }
@@ -108,10 +109,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