Sha256: c5db246fed249d78bb8ae339653330bf18c6d14153b9e9ee64f3f2f7df4e284e

Contents?: true

Size: 913 Bytes

Versions: 7

Compression:

Stored size: 913 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Punchblock
  class Event
    describe DTMF do
      it 'registers itself' do
        expect(RayoNode.class_from_registration(:dtmf, 'urn:xmpp:rayo:1')).to eq(described_class)
      end

      describe "from a stanza" do
        let(:stanza) { "<dtmf xmlns='urn:xmpp:rayo:1' signal='#' />" }

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

        it { should be_instance_of described_class }

        it_should_behave_like 'event'

        describe '#signal' do
          subject { super().signal }
          it { should be == '#' }
        end
      end

      describe "when setting options in initializer" do
        subject do
          described_class.new :signal => '#'
        end

        describe '#signal' do
          subject { super().signal }
          it { should be == '#' }
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
punchblock-2.7.5 spec/punchblock/event/dtmf_spec.rb
punchblock-2.7.3 spec/punchblock/event/dtmf_spec.rb
punchblock-2.7.2 spec/punchblock/event/dtmf_spec.rb
punchblock-2.7.1 spec/punchblock/event/dtmf_spec.rb
punchblock-2.7.0 spec/punchblock/event/dtmf_spec.rb
punchblock-2.6.0 spec/punchblock/event/dtmf_spec.rb
punchblock-2.5.3 spec/punchblock/event/dtmf_spec.rb