Sha256: d9cea5c74ac245c438a46cd8afea6cb5a0609e23361277a2bcb98107db0b8f5f

Contents?: true

Size: 1017 Bytes

Versions: 19

Compression:

Stored size: 1017 Bytes

Contents

require 'spec_helper'
require 'mailgun'

vcr_opts = { :cassette_name => "domains" }

describe 'For the domains endpoint', vcr: vcr_opts do
  before(:all) do
    @mg_client = Mailgun::Client.new(APIKEY, APIHOST, APIVERSION, SSL)
    @mg_obj = Mailgun::Domains.new(@mg_client)
    @domain = "integration-test.domain.invalid"
  end

  it 'creates the domain' do
    result = @mg_obj.add_domain(@domain, { smtp_password: 'super_secret', spam_action: 'tag' })

    expect(result['domain']["name"]).to eq(@domain)
    expect(result['domain']["spam_action"]).to eq("tag")
    expect(result['domain']["smtp_password"]).to eq("super_secret")
  end

  it 'get the domain.' do
    result = @mg_obj.get(@domain)

    expect(result).to include("domain")
    expect(result["domain"]["name"]).to eq(@domain)
  end

  it 'gets a list of domains.' do
    result = @mg_obj.get_domains

    expect(result.size).to be > 0
  end

  it 'deletes a domain.' do
    result = @mg_obj.delete(@domain)

    expect(result).to be_truthy
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
mailgun-ruby-1.2.8 spec/integration/domains_spec.rb
mailgun-ruby-1.2.7 spec/integration/domains_spec.rb
mailgun-ruby-1.2.6 spec/integration/domains_spec.rb
mailgun-ruby-1.2.5 spec/integration/domains_spec.rb
mailgun-ruby-1.2.4 spec/integration/domains_spec.rb
mailgun-ruby-1.2.3 spec/integration/domains_spec.rb
mailgun-ruby-1.2.0 spec/integration/domains_spec.rb
mailgun-ruby-1.1.11 spec/integration/domains_spec.rb
mailgun-ruby-1.1.10 spec/integration/domains_spec.rb
mailgun-ruby-1.1.9 spec/integration/domains_spec.rb
wj-mailgun-ruby-1.1.7 spec/integration/domains_spec.rb
mailgun-ruby-1.1.8 spec/integration/domains_spec.rb
mailgun-ruby-1.1.6 spec/integration/domains_spec.rb
mailgun-ruby-1.1.5 spec/integration/domains_spec.rb
mailgun-ruby-1.1.4 spec/integration/domains_spec.rb
mailgun-ruby-1.1.3 spec/integration/domains_spec.rb
mailgun-ruby-1.1.2 spec/integration/domains_spec.rb
mailgun-ruby-1.1.1 spec/integration/domains_spec.rb
mailgun-ruby-1.1.0 spec/integration/domains_spec.rb