Sha256: c86266695d048b2d7e8cc69f3f9d80233da5246215525821c7b8f2c46e5dad50

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

require 'spec_helper'

describe Cellular::Jobs::AsyncMessenger do
  let(:sms_stub)    { double "SMS", deliver: true }
  let(:sms_options) { { "recipient" => "12345678", "text" => "Foo" } }

  before do
    allow(Cellular::SMS).to receive(:new).and_return sms_stub
  end

  it 'creates a new SMS object' do
    symbolized_sms_options = { recipient: "12345678", text: "Foo" }

    subject.perform sms_options

    expect(Cellular::SMS).to have_received(:new)
      .with(symbolized_sms_options)
  end

  it "delivers the SMS" do
    subject.perform sms_options

    expect(sms_stub).to have_received :deliver
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cellular-2.1.0 spec/cellular/jobs/async_messenger_spec.rb