Sha256: aeb932dd4293b624eb9a821bbc2b8b564c93ce99fa6e395df3fac16596e1e338

Contents?: true

Size: 711 Bytes

Versions: 3

Compression:

Stored size: 711 Bytes

Contents

require 'spec_helper'

describe Ecommerce::Resources::InvoicePlan do
  describe '.find_all', vcr: true do
    context 'when success' do
      subject { described_class.find_all('rexpense-custom-monthly-brl-5250') }

      it 'returns a find_all of orders' do
        expect(subject.class).to eq(Ecommerce::Resources::InvoiceOrderCollection)
        expect(subject.orders.first.class).to eq(Ecommerce::Resources::InvoiceOrder)
        expect(subject.orders.count).to eq(1)
      end
    end

    context 'when not found' do
      subject { described_class.find_all(2704, 'wrong-slug') }

      it 'raises NotFound' do
        expect{ subject }.to raise_error(Ecommerce::RequestError)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ecommerce-client-0.0.5 spec/ecommerce/resources/invoice_plan_spec.rb
ecommerce-client-0.0.4 spec/ecommerce/resources/invoice_plan_spec.rb
ecommerce-client-0.0.3 spec/ecommerce/resources/invoice_plan_spec.rb