Sha256: 3ef5dfd70af4a0a28595a7076876349eca96fd0d33789c6f0e76762897b8366c

Contents?: true

Size: 1006 Bytes

Versions: 5

Compression:

Stored size: 1006 Bytes

Contents

require 'spec_helper'

RSpec.describe Chartmogul::V1::Import::Customers do

  let(:client) { Chartmogul::Client.new }

  describe '#invoices' do
    subject { client.import.customers.invoices }

    it { expect(subject).to be_a Chartmogul::V1::Import::Invoices }
    it { expect(subject.client).to eq client }
  end

  describe '#create' do
    let(:url) { 'https://api.chartmogul.com/v1/import/customers' }
    let(:query) { { foo: 'bar' } }

    before do
      stub_request(:post, url).with(query: query).to_return(status: 201)
    end

    subject { client.import.customers.create(query) }

    it_should_behave_like 'a base ChartMogul API V1 requests', method: :post
  end

  describe '#list' do
    let(:url) { 'https://api.chartmogul.com/v1/import/customers' }
    let(:query) { { } }

    before do
      stub_request(:get, url).with(query: query).to_return(status: 200)
    end

    subject { client.import.customers.list }

    it_should_behave_like 'a base ChartMogul API V1 requests'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chartmogul_client-0.0.6 spec/chartmogul/v1/import/customers_spec.rb
chartmogul_client-0.0.5 spec/chartmogul/v1/import/customers_spec.rb
chartmogul_client-0.0.4 spec/chartmogul/v1/import/customers_spec.rb
chartmogul_client-0.0.3 spec/chartmogul/v1/import/customers_spec.rb
chartmogul_client-0.0.2 spec/chartmogul/v1/import/customers_spec.rb