Sha256: d931b6ff67fbf2c893b2d88e52a8484c315f1435f0381dfc01a230decbdca403

Contents?: true

Size: 1.14 KB

Versions: 13

Compression:

Stored size: 1.14 KB

Contents

# encoding: utf-8

require 'spec_helper'

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

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

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

        it { should be_instance_of End }

        it_should_behave_like 'event'
        it_should_behave_like 'event_headers'

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

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

        its(:reason) { should be == :hangup }
        it_should_behave_like 'event_headers'
      end
    end
  end
end # Punchblock

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
punchblock-1.5.3 spec/punchblock/event/end_spec.rb
punchblock-1.5.2 spec/punchblock/event/end_spec.rb
punchblock-1.5.1 spec/punchblock/event/end_spec.rb
punchblock-1.5.0 spec/punchblock/event/end_spec.rb
punchblock-1.4.1 spec/punchblock/event/end_spec.rb
punchblock-1.4.0 spec/punchblock/event/end_spec.rb
punchblock-1.3.0 spec/punchblock/event/end_spec.rb
punchblock-1.2.0 spec/punchblock/event/end_spec.rb
punchblock-1.1.0 spec/punchblock/event/end_spec.rb
punchblock-1.0.0 spec/punchblock/event/end_spec.rb
punchblock-0.12.0 spec/punchblock/event/end_spec.rb
punchblock-0.11.0 spec/punchblock/event/end_spec.rb
punchblock-0.10.0 spec/punchblock/event/end_spec.rb