Sha256: a70d57c68dda90751325a1579952a4204f002ea4a49bc9ed54b5e0bb142437d3

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

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

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

  describe "self._new" do
    it "initializes the object with the appropriate attributes set" do
      params = {
        payment_id: "a-payment-id",
        payment_context_id: "a-payment-context-id",
        transaction: {
          id: "a-transaction-id",
          amount: "31.00",
          order_id: "an-order-id",
          status: Braintree::Transaction::Status::Settled,
        },
      }
      local_payment_funded = Braintree::LocalPaymentFunded._new(params)

      expect(local_payment_funded.payment_id).to eq("a-payment-id")
      expect(local_payment_funded.payment_context_id).to eq("a-payment-context-id")
      expect(local_payment_funded.transaction.id).to eq("a-transaction-id")
      expect(local_payment_funded.transaction.amount).to eq(31.0)
      expect(local_payment_funded.transaction.order_id).to eq("an-order-id")
      expect(local_payment_funded.transaction.status).to eq(Braintree::Transaction::Status::Settled)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
braintree-4.23.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.22.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.21.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.20.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.19.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.18.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.17.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.16.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.15.0 spec/unit/braintree/local_payment_funded_spec.rb