spec/punchblock/component/output_spec.rb in punchblock-0.11.0 vs spec/punchblock/component/output_spec.rb in punchblock-0.12.0

- old
+ new

@@ -102,31 +102,31 @@ let(:mock_client) { mock 'Client' } let(:command) { Output.new :text => 'Once upon a time there was a message...', :voice => 'kate' } before do command.component_id = 'abc123' - command.call_id = '123abc' + command.target_call_id = '123abc' command.client = mock_client end describe '#pause_action' do subject { command.pause_action } its(:to_xml) { should be == '<pause xmlns="urn:xmpp:rayo:output:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#pause!' do describe "when the command is executing" do before do command.request! command.execute! end it "should send its command properly" do - mock_client.expects(:execute_command).with(command.pause_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(command.pause_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :paused! command.pause! end end @@ -154,11 +154,11 @@ describe '#resume_action' do subject { command.resume_action } its(:to_xml) { should be == '<resume xmlns="urn:xmpp:rayo:output:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#resume!' do describe "when the command is paused" do before do @@ -166,11 +166,11 @@ command.execute! command.paused! end it "should send its command properly" do - mock_client.expects(:execute_command).with(command.resume_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(command.resume_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :resumed! command.resume! end end @@ -199,22 +199,22 @@ describe '#stop_action' do subject { command.stop_action } its(:to_xml) { should be == '<stop xmlns="urn:xmpp:rayo:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#stop!' do describe "when the command is executing" do before do command.request! command.execute! end it "should send its command properly" do - mock_client.expects(:execute_command).with(command.stop_action, :call_id => '123abc', :component_id => 'abc123') + mock_client.expects(:execute_command).with(command.stop_action, :target_call_id => '123abc', :component_id => 'abc123') command.stop! end end describe "when the command is not executing" do @@ -230,11 +230,11 @@ describe '#seek_action' do subject { command.seek_action seek_options } its(:to_xml) { should be == '<seek xmlns="urn:xmpp:rayo:output:1" direction="forward" amount="1500"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#seek!' do describe "when not seeking" do before do @@ -243,11 +243,11 @@ end it "should send its command properly" do seek_action = command.seek_action seek_options command.stubs(:seek_action).returns seek_action - mock_client.expects(:execute_command).with(seek_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(seek_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :seeking! command.expects :stopped_seeking! command.seek! seek_options seek_action.request! seek_action.execute! @@ -297,11 +297,11 @@ describe '#speed_up_action' do subject { command.speed_up_action } its(:to_xml) { should be == '<speed-up xmlns="urn:xmpp:rayo:output:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#speed_up!' do describe "when not altering speed" do before do @@ -310,11 +310,11 @@ end it "should send its command properly" do speed_up_action = command.speed_up_action command.stubs(:speed_up_action).returns speed_up_action - mock_client.expects(:execute_command).with(speed_up_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(speed_up_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :speeding_up! command.expects :stopped_speeding! command.speed_up! speed_up_action.request! speed_up_action.execute! @@ -355,11 +355,11 @@ describe '#slow_down_action' do subject { command.slow_down_action } its(:to_xml) { should be == '<speed-down xmlns="urn:xmpp:rayo:output:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#slow_down!' do describe "when not altering speed" do before do @@ -368,11 +368,11 @@ end it "should send its command properly" do slow_down_action = command.slow_down_action command.stubs(:slow_down_action).returns slow_down_action - mock_client.expects(:execute_command).with(slow_down_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(slow_down_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :slowing_down! command.expects :stopped_speeding! command.slow_down! slow_down_action.request! slow_down_action.execute! @@ -430,11 +430,11 @@ describe '#volume_up_action' do subject { command.volume_up_action } its(:to_xml) { should be == '<volume-up xmlns="urn:xmpp:rayo:output:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#volume_up!' do describe "when not altering volume" do before do @@ -443,11 +443,11 @@ end it "should send its command properly" do volume_up_action = command.volume_up_action command.stubs(:volume_up_action).returns volume_up_action - mock_client.expects(:execute_command).with(volume_up_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(volume_up_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :voluming_up! command.expects :stopped_voluming! command.volume_up! volume_up_action.request! volume_up_action.execute! @@ -488,11 +488,11 @@ describe '#volume_down_action' do subject { command.volume_down_action } its(:to_xml) { should be == '<volume-down xmlns="urn:xmpp:rayo:output:1"/>' } its(:component_id) { should be == 'abc123' } - its(:call_id) { should be == '123abc' } + its(:target_call_id) { should be == '123abc' } end describe '#volume_down!' do describe "when not altering volume" do before do @@ -501,10 +501,10 @@ end it "should send its command properly" do volume_down_action = command.volume_down_action command.stubs(:volume_down_action).returns volume_down_action - mock_client.expects(:execute_command).with(volume_down_action, :call_id => '123abc', :component_id => 'abc123').returns true + mock_client.expects(:execute_command).with(volume_down_action, :target_call_id => '123abc', :component_id => 'abc123').returns true command.expects :voluming_down! command.expects :stopped_voluming! command.volume_down! volume_down_action.request! volume_down_action.execute!