Sha256: d948aa0addcb5b04b48507d6a357fc10581294ee2343360d5406e5fea21536bd

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

module Punchblock
  class Event
    describe Ringing do
      it 'registers itself' do
        RayoNode.class_from_registration(:ringing, 'urn:xmpp:rayo:1').should == Ringing
      end

      describe "from a stanza" do
        let :stanza do
          <<-MESSAGE
<ringing xmlns='urn:xmpp:rayo:1'>
  <!-- Signaling (e.g. SIP) Headers -->
  <header name="x-skill" value="agent" />
  <header name="x-customer-id" value="8877" />
</ringing>
          MESSAGE
        end

        subject { RayoNode.import parse_stanza(stanza).root, '9f00061', '1' }

        it { should be_instance_of Ringing }

        it_should_behave_like 'event'
        it_should_behave_like 'event_headers'

        its(:xmlns) { should == 'urn:xmpp:rayo:1' }
      end

      describe "when setting options in initializer" do
        subject do
          Ringing.new :headers => { :x_skill => "agent", :x_customer_id => "8877" }
        end

        it_should_behave_like 'event_headers'
      end
    end
  end
end # Punchblock

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
punchblock-0.9.2 spec/punchblock/event/ringing_spec.rb
punchblock-0.9.1 spec/punchblock/event/ringing_spec.rb
punchblock-0.9.0 spec/punchblock/event/ringing_spec.rb
punchblock-0.8.4 spec/punchblock/event/ringing_spec.rb