Sha256: 0a95eb3ebe9dc18a24980fecf2c22f23f7fafc4a452f40a36fe40259ff41416b
Contents?: true
Size: 1.93 KB
Versions: 10
Compression:
Stored size: 1.93 KB
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'] ) FakeWeb.register_uri( :get, "https://TOKEN2:KEY2@api.moip.com.br/assinaturas/v1/invoices/14/payments", body: File.join(File.dirname(__FILE__), '..', 'fixtures', 'custom_authentication', 'list_payments.json'), status: [200, 'OK'] ) FakeWeb.register_uri( :get, "https://TOKEN2:KEY2@api.moip.com.br/assinaturas/v1/payments/7", body: File.join(File.dirname(__FILE__), '..', 'fixtures', 'custom_authentication', '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 context "Custom Authentication" do it "should get all payments from a invoice" do request = Moip::Assinaturas::Payment.list(14, moip_auth: $custom_moip_auth) request[:success].should be_true request[:payments].size.should == 1 end it "should get details of a payment" do request = Moip::Assinaturas::Payment.details(7, moip_auth: $custom_moip_auth) request[:success].should be_true request[:payment][:id].should == 7 end end end
Version data entries
10 entries across 10 versions & 1 rubygems