Sha256: 4431ffee7468740c127790390bb3d066c75d0bca0873fdcc6f5d010661510693

Contents?: true

Size: 871 Bytes

Versions: 7

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'
require 'webmock/rspec'

describe Gibbon::Export do
  before do
    Gibbon::Export.send(:public, *Gibbon::Export.protected_instance_methods)
    @export = Gibbon::Export.new
  end

  it "doesn't allow empty api key" do
    expect {@export.list(id: "123456")}.to raise_error(Gibbon::GibbonError)
  end

  it "doesn't allow api key without data center" do
    @api_key = "123"
    @export.api_key = @api_key
    expect {@export.list(id: "123456")}.to raise_error(Gibbon::GibbonError)
  end

  it "sets correct endpoint from api key" do
    @api_key = "TESTKEY-us1"
    @export.api_key = @api_key
    expect(@export.export_api_url).to eq("https://us1.api.mailchimp.com/export/1.0/")
  end

  it "sets correct timeout" do
    @api_key = "TESTKEY-us1"
    @export.api_key = @api_key
    @export.timeout = 9
    expect(@export.timeout).to eq(9)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gibbon-3.3.3 spec/gibbon/export_spec.rb
gibbon-3.3.2 spec/gibbon/export_spec.rb
gibbon-3.3.1 spec/gibbon/export_spec.rb
gibbon-3.3.0 spec/gibbon/export_spec.rb
gibbon-3.2.0 spec/gibbon/export_spec.rb
gibbon-3.1.1 spec/gibbon/export_spec.rb
gibbon-3.1.0 spec/gibbon/export_spec.rb