Sha256: 26b1e74401a9caf552b516006e460ad0cfc077a9ca9f1c6a9f656e3667a567c1

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Cellular::Backends::Test do

  let(:recipient) { '47xxxxxxxx' }
  let(:sender)    { 'Custom sender' }
  let(:message)   { 'This is an SMS message' }
  let(:price)     { 100 }
  let(:country)   { 'NO '}

  let(:options) {
    {
      recipient: recipient,
      sender: sender,
      message: message,
      price: price
    }
  }

  before do
    Cellular.config.username = 'username'
    Cellular.config.password = 'password'
    Cellular.config.delivery_url = nil
  end

  describe '::deliver' do
    let(:deliveries) { Cellular.deliveries }
    let(:delivery)   { deliveries.first }

    before do
      Cellular.deliveries.clear
    end

    it 'appends the message to deliveries' do
      described_class.deliver message: 'This is a message'
      expect(deliveries.count).to eq 1
    end

    it 'stores the message of the message' do
      described_class.deliver message: 'This is a message'
      expect(delivery).to eq 'This is a message'
    end
  end

  describe '::receive' do
    it 'has not been implemented yet' do
      expect do
        described_class.receive ''
      end.to raise_error NotImplementedError
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cellular-2.1.0 spec/cellular/backends/test_spec.rb
cellular-2.0.0 spec/cellular/backends/test_spec.rb
cellular-1.3.0 spec/cellular/backends/test_spec.rb