Sha256: bbda889d6a978077d0479251f76b995967926776459fcab790d561cd3cfa3225

Contents?: true

Size: 1.67 KB

Versions: 6

Compression:

Stored size: 1.67 KB

Contents

# Unit tests for Bandwidth::Bxml::Forward
describe 'Bandwidth::Bxml::Forward' do
  let(:initial_attributes) {
    {
      to: '+19195551234',
      from: '+19195554321',
      call_timeout: 5,
      diversion_treatment: 'propogate',
      diversion_reason: 'user-busy',
      uui: '93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt'
    }
  }

  let(:new_attributes) {
    {
      to: '+19195554321',
      from: '+19195551234',
      call_timeout: 10,
      diversion_treatment: 'stack',
      diversion_reason: 'no-answer',
      uui: '4fa28015d8ede84bd1a493d6f3c0be5845960b74;encoding=base64,fdsa;encoding=jwt'
    }
  }

  let(:instance) { Bandwidth::Bxml::Forward.new(initial_attributes) }

  describe 'test an instance of Forward' do
    it 'validates instance of Forward' do
      expect(instance).to be_instance_of(Bandwidth::Bxml::Forward)
      expect(instance).to be_a(Bandwidth::Bxml::Verb)
    end

    it 'tests the to_bxml method of the Forward instance' do
      expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" callTimeout=\"5\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'tests the set_attributes method of the Forward instance' do
      instance.set_attributes(new_attributes)
      expected = "\n<Forward to=\"+19195554321\" from=\"+19195551234\" callTimeout=\"10\" diversionTreatment=\"stack\" diversionReason=\"no-answer\" uui=\"4fa28015d8ede84bd1a493d6f3c0be5845960b74;encoding=base64,fdsa;encoding=jwt\"/>\n"
      expect(instance.to_bxml).to eq(expected)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bandwidth-sdk-11.1.0 spec/models/bxml/verbs/forward_spec.rb
bandwidth-sdk-11.0.0 spec/models/bxml/verbs/forward_spec.rb
bandwidth-sdk-11.0.0.pre.beta.4.0 spec/models/bxml/verbs/forward_spec.rb
bandwidth-sdk-11.0.0.pre.beta.3.1 spec/models/bxml/verbs/forward_spec.rb
bandwidth-sdk-11.0.0.pre.beta.3.0 spec/models/bxml/verbs/forward_spec.rb
bandwidth-sdk-11.0.0.pre.beta.2.0 spec/models/bxml/verbs/forward_spec.rb