Sha256: b2cc9f74725672e2bad7b85a17b6e5d73afed16ec0b8cf1efa0966ce3a095292

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

require 'spec_helper'

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

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

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

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

    subject { client.import.plans.create(body) }

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

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

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

    subject { client.import.plans.list }

    it_should_behave_like 'a base ChartMogul API V1 requests'
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chartmogul_client-0.0.6 spec/chartmogul/v1/import/plans_spec.rb
chartmogul_client-0.0.5 spec/chartmogul/v1/import/plans_spec.rb