Sha256: d0b8eec5e1958171c6928f259946fb0602845b0b35721dab94f7742198ac3b3f

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

RSpec.describe Chartmogul::V1::Import do

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

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

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

  describe '::Customers' do
    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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chartmogul_client-0.0.1 spec/chartmogul/v1/import_spec.rb