Sha256: d0d554847980fad9d7a82104f5a242b83814c5f192d8e64e0f02718eba1a0365

Contents?: true

Size: 731 Bytes

Versions: 4

Compression:

Stored size: 731 Bytes

Contents

# -*- coding: utf-8 -*-
require File.expand_path('../../test_helper', __FILE__)

module Peakium
  class InvoiceTest < Test::Unit::TestCase
    should "invoices should be listable" do
      @mock.expects(:get).once.returns(test_response(test_invoice_array))
      i = Peakium::Invoice.all.data
      assert i.kind_of? Array
      assert i[0].kind_of? Peakium::Invoice
    end

    should "be able to attempt payment of an invoice" do
      @mock.expects(:get).once.returns(test_response(test_invoice))
      i = Peakium::Invoice.retrieve("in_test_invoice")

      @mock.expects(:post).once.with("#{Peakium.api_base}/v1/invoices/in_test_invoice/pay", nil, '').returns(test_response(test_invoice()))
      i = i.pay;
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
peakium-0.1.4 test/peakium/invoice_test.rb
peakium-0.1.3 test/peakium/invoice_test.rb
peakium-0.1.2 test/peakium/invoice_test.rb
peakium-0.1.1 test/peakium/invoice_test.rb