Sha256: 0e44d7643976f379ec6d6511a261c63ce0ed3111fcf250c4c9fc0cda267f70fd

Contents?: true

Size: 768 Bytes

Versions: 5

Compression:

Stored size: 768 Bytes

Contents

require 'spec_helper'
require 'mailgun'
require 'mailgun/events/events'

vcr_opts = { :cassette_name => "events" }

describe 'For the Events endpoint', vcr: vcr_opts do
  before(:all) do
    @mg_obj = Mailgun::Client.new(APIKEY, APIHOST, APIVERSION, SSL)
    @domain = TESTDOMAIN
    @events = Mailgun::Events.new(@mg_obj, @domain)
  end

  it 'can get an event.' do
    result = @mg_obj.get("#{@domain}/events", {:limit => 1})

    result.to_h!
    expect(result.body["items"].length).to be_within(1).of(1)
    expect(result.body["paging"]).to include("next")
    expect(result.body["paging"]).to include("previous")
  end

  it 'can iterate over all events with `each`' do
    @events.each do |e|
      expect(e.id).to eq("JAx9z641TuGGUyaJlD9sCQ")
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mailgun-ruby-1.1.10 spec/integration/events_spec.rb
mailgun-ruby-1.1.9 spec/integration/events_spec.rb
wj-mailgun-ruby-1.1.7 spec/integration/events_spec.rb
mailgun-ruby-1.1.8 spec/integration/events_spec.rb
mailgun-ruby-1.1.6 spec/integration/events_spec.rb