Sha256: 2dba1c77021f4bfbe1b794c8d33d220e04801eed2d343d47eeb656e40a6134af

Contents?: true

Size: 812 Bytes

Versions: 6

Compression:

Stored size: 812 Bytes

Contents

require 'spec_helper'

describe BrazeRuby::REST::ScheduleMessages do
  let(:http) { double(:http) }

  let(:payload) {{
    external_user_ids: :external_user_ids,
    time: :time,
    in_local_time: :in_local_time,
    messages: :messages
  }}

  let(:api_key) { :api_key }

  subject { described_class.new(api_key, :rest_url, payload) }

  before { subject.http = http }

  it 'makes an http call to the schedule messages endpoint' do
    expect_schedule_messages_http_call

    subject.perform
  end

  def expect_schedule_messages_http_call
    expect(http).to receive(:post).with '/messages/schedule/create', {
      api_key: api_key,
      external_user_ids: :external_user_ids,
      schedule: {
        time: :time,
        in_local_time: :in_local_time
      },
      messages: :messages
    }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
braze_ruby-0.2.2 spec/braze_ruby/rest/schedule_messages_spec.rb
braze_ruby-0.2.1 spec/braze_ruby/rest/schedule_messages_spec.rb
braze_ruby-0.2.0 spec/braze_ruby/rest/schedule_messages_spec.rb
braze_ruby-0.1.0 spec/braze_ruby/rest/schedule_messages_spec.rb
braze_ruby-0.0.2 spec/braze_ruby/rest/schedule_messages_spec.rb
braze_ruby-0.0.1 spec/braze_ruby/rest/schedule_messages_spec.rb