Sha256: f5fcb8220658be685feb0883804ea60df28972b80a1219050f71f5b5de96b452

Contents?: true

Size: 1.77 KB

Versions: 12

Compression:

Stored size: 1.77 KB

Contents

# Unit tests for Bandwidth::Bxml::Response
describe 'Bandwidth::Bxml::Response' do
  let(:instance) { Bandwidth::Bxml::Response.new }
  let(:pause_recording) { Bandwidth::Bxml::PauseRecording.new }

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

    it 'test initializing with a single nested verb' do
      instance = Bandwidth::Bxml::Response.new(pause_recording)
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n  <PauseRecording/>\n</Response>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test initializing with multiple nested verbs' do
      instance = Bandwidth::Bxml::Response.new([pause_recording, pause_recording])
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n  <PauseRecording/>\n  <PauseRecording/>\n</Response>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test adding a single verb to the Response instance' do
      instance.add_verbs(pause_recording)
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n  <PauseRecording/>\n</Response>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test adding multiple verbs to the Response instance' do
      instance.add_verbs([pause_recording, pause_recording])
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n  <PauseRecording/>\n  <PauseRecording/>\n</Response>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test the to_bxml method of the Response instance' do
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response/>\n"
      expect(instance.to_bxml).to eq(expected)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bandwidth-sdk-14.1.1 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-14.1.0 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-14.0.0 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-13.1.4 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-13.1.3 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-13.1.2 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-13.1.1 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-13.1.0 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-13.0.0 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-12.1.0 spec/unit/models/bxml/response_spec.rb
bandwidth-sdk-11.3.0 spec/models/bxml/response_spec.rb
bandwidth-sdk-11.2.0 spec/models/bxml/response_spec.rb