Sha256: 70e755325497fe4b9601f63686a7f476e7c6634dfe4620088907c13dad17a046

Contents?: true

Size: 954 Bytes

Versions: 6

Compression:

Stored size: 954 Bytes

Contents

# coding: utf-8
require 'spec_helper'

describe Moip::Assinaturas::Payment do

  before(:all) do

    FakeWeb.register_uri(
      :get, 
      "https://TOKEN:KEY@api.moip.com.br/assinaturas/v1/invoices/13/payments", 
      body:   File.join(File.dirname(__FILE__), '..', 'fixtures', 'list_payments.json'),
      status: [200, 'OK']
    )

    FakeWeb.register_uri(
      :get, 
      "https://TOKEN:KEY@api.moip.com.br/assinaturas/v1/payments/6", 
      body:   File.join(File.dirname(__FILE__), '..', 'fixtures', 'details_payment.json'),
      status: [200, 'OK']
    )

  end

  it "should get all payments from a invoice" do
    request = Moip::Assinaturas::Payment.list(13)
    request[:success].should    be_true
    request[:payments].size.should == 1
  end

  it "should get details of a payment" do
    request = Moip::Assinaturas::Payment.details(6)
    request[:success].should        be_true
    request[:payment][:id].should   == 6
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
moip-assinaturas-0.1.3 spec/moip-assinaturas/payment_spec.rb
moip-assinaturas-0.1.2 spec/moip-assinaturas/payment_spec.rb
moip-assinaturas-0.1.1 spec/moip-assinaturas/payment_spec.rb
moip-assinaturas-0.1.0 spec/moip-assinaturas/payment_spec.rb
moip-assinaturas-0.0.3 spec/moip-assinaturas/payment_spec.rb
moip-assinaturas-0.0.2 spec/moip-assinaturas/payment_spec.rb