Sha256: 2d07fa48df148a96375821e907e965f0c1b128d7f59d89c97ada4ef55bf0214a

Contents?: true

Size: 1.34 KB

Versions: 4

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe 'The method get' do
  it 'should return a proper hash of log data.' do
    @mg_obj = Mailgun::UnitClient.new('events')
    events = Mailgun::Events.new(@mg_obj, "samples.mailgun.org")
    result = events.get()

    expect(result.body).to include("items")
    expect(result.body).to include("paging")
  end
end


describe 'The method next' do
  it 'should return the next series of data.' do
    @mg_obj = Mailgun::UnitClient.new('events')
    events = Mailgun::Events.new(@mg_obj, "samples.mailgun.org")
    result = events.next()

    expect(result.body).to include("items")
    expect(result.body).to include("paging")
  end
end

describe 'The method previous' do
  it 'should return the previous series of data.' do
    @mg_obj = Mailgun::UnitClient.new('events')
    events = Mailgun::Events.new(@mg_obj, "samples.mailgun.org")
    result = events.previous()

    expect(result.body).to include("items")
    expect(result.body).to include("paging")
  end
end

describe 'The method each' do
  it 'should iterate over all event items.' do
    @mg_obj = Mailgun::UnitClient.new('events')
    events = Mailgun::Events.new(@mg_obj, "samples.mailgun.org")
    # Events from the UnitClient are actually empty.
    count = 0
    events.each do |e|
      count = count + 1
    end

    # Better than nothing..
    expect(count).to eq(0)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mailgun-ruby-1.1.9 spec/unit/events/events_spec.rb
wj-mailgun-ruby-1.1.7 spec/unit/events/events_spec.rb
mailgun-ruby-1.1.8 spec/unit/events/events_spec.rb
mailgun-ruby-1.1.6 spec/unit/events/events_spec.rb