spec/punchblock/command/dial_spec.rb in punchblock-0.8.3 vs spec/punchblock/command/dial_spec.rb in punchblock-0.8.4
- old
+ new
@@ -1,13 +1,7 @@
require 'spec_helper'
-%w{
- blather/client/dsl
- punchblock/core_ext/blather/stanza
- punchblock/core_ext/blather/stanza/presence
-}.each { |f| require f }
-
module Punchblock
module Command
describe Dial do
it 'registers itself' do
@@ -15,23 +9,24 @@
end
let(:join_params) { {:other_call_id => 'abc123'} }
describe "when setting options in initializer" do
- subject { Dial.new :to => 'tel:+14155551212', :from => 'tel:+13035551212', :headers => { :x_skill => 'agent', :x_customer_id => 8877 }, :join => join_params }
+ subject { Dial.new :to => 'tel:+14155551212', :from => 'tel:+13035551212', :timeout => 30000, :headers => { :x_skill => 'agent', :x_customer_id => 8877 }, :join => join_params }
it_should_behave_like 'command_headers'
- its(:to) { should == 'tel:+14155551212' }
- its(:from) { should == 'tel:+13035551212' }
- its(:join) { should == Join.new(join_params) }
+ its(:to) { should == 'tel:+14155551212' }
+ its(:from) { should == 'tel:+13035551212' }
+ its(:timeout) { should == 30000 }
+ its(:join) { should == Join.new(join_params) }
end
describe "from a stanza" do
let :stanza do
<<-MESSAGE
-<dial to='tel:+14155551212' from='tel:+13035551212' xmlns='urn:xmpp:rayo:1'>
+<dial to='tel:+14155551212' from='tel:+13035551212' timeout='30000' xmlns='urn:xmpp:rayo:1'>
<join call-id="abc123" />
<header name="x-skill" value="agent" />
<header name="x-customer-id" value="8877" />
</dial>
MESSAGE
@@ -39,12 +34,13 @@
subject { RayoNode.import parse_stanza(stanza).root, '9f00061', '1' }
it { should be_instance_of Dial }
- its(:to) { should == 'tel:+14155551212' }
- its(:from) { should == 'tel:+13035551212' }
- its(:join) { should == Join.new(join_params) }
+ its(:to) { should == 'tel:+14155551212' }
+ its(:from) { should == 'tel:+13035551212' }
+ its(:timeout) { should == 30000 }
+ its(:join) { should == Join.new(join_params) }
end
describe "#response=" do
before { subject.request! }