Sha256: 9840297185e6fc63649b85162b527f6007a7b9dc44de06a1ecb2dafa3aa912fd

Contents?: true

Size: 952 Bytes

Versions: 4

Compression:

Stored size: 952 Bytes

Contents

# frozen_string_literal: true

RSpec.describe TwilioBase::Application do
  let(:attributes) do
    {
      friendly_name: 'Base Application',
      sms_url: sms_url,
      sms_method: 'POST',
      voice_url: voice_url,
      voice_method: 'POST'
    }
  end
  let(:sms_url) { 'https://sms_url.com' }
  let(:voice_url) { 'https://voice_url.com' }

  describe '#create' do
    it 'creates a new application on Twilio' do
      expect { described_class.create(attributes) }
        .to change { TwilioBase::Fake::Application.applications.count }.by(1)
    end

    it 'assigns correct values to the applcation' do
      application = described_class.create(attributes)
      expect(application.friendly_name).to eq 'Base Application'
      expect(application.sms_url).to eq sms_url
      expect(application.sms_method).to eq 'POST'
      expect(application.voice_url).to eq voice_url
      expect(application.voice_method).to eq 'POST'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twilio_base-1.11.1101 spec/services/twilio_base/application_spec.rb
twilio_base-1.11.11 spec/services/twilio_base/application_spec.rb
twilio_base-1.9.0 spec/services/twilio_base/application_spec.rb
twilio_base-1.8.0 spec/services/twilio_base/application_spec.rb