Sha256: 0045ce3c0d2662580a57b327ac4b0bf662bfcc989c0774744857b955a9538f08

Contents?: true

Size: 1.64 KB

Versions: 36

Compression:

Stored size: 1.64 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

describe Braintree::Disbursement do
  describe "new" do
    it "is protected" do
      expect do
        Braintree::Disbursement.new
      end.to raise_error(NoMethodError, /protected method .new/)
    end
  end

  describe "inspect" do
    it "prints attributes of disbursement object" do
      disbursement = Braintree::Disbursement._new(
        :gateway,
        :id => "123456",
        :merchant_account => {
          :id => "sandbox_sub_merchant_account",
          :master_merchant_account => {
            :id => "sandbox_master_merchant_account",
            :status => "active"
          },
          :status => "active"
        },
        :transaction_ids => ["sub_merchant_transaction"],
        :amount => "100.00",
        :disbursement_date => "2013-04-10",
        :exception_message => "invalid_account_number",
        :follow_up_action => "update",
        :retry => false,
        :success => false
      )

      disbursement.inspect.should include('id: "123456"')
      disbursement.inspect.should include('amount: "100.0"')
      disbursement.inspect.should include('exception_message: "invalid_account_number"')
      disbursement.inspect.should include('disbursement_date: 2013-04-10')
      disbursement.inspect.should include('follow_up_action: "update"')
      disbursement.inspect.should include('merchant_account: #<Braintree::MerchantAccount: ')
      disbursement.inspect.should include('transaction_ids: ["sub_merchant_transaction"]')
      disbursement.inspect.should include('retry: false')
      disbursement.inspect.should include('success: false')
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
braintree-2.62.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.61.1 spec/unit/braintree/disbursement_spec.rb
braintree-2.61.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.60.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.59.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.58.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.57.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.56.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.55.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.54.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.50.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.49.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.48.1 spec/unit/braintree/disbursement_spec.rb
braintree-2.48.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.47.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.46.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.45.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.44.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.43.0 spec/unit/braintree/disbursement_spec.rb
braintree-2.42.0 spec/unit/braintree/disbursement_spec.rb