Sha256: 6ad4876cbb6f3e778c3fe277bd735d5f09f41e4734671bb1aab2414201104fd4

Contents?: true

Size: 1.21 KB

Versions: 11

Compression:

Stored size: 1.21 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)

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
braintree-4.14.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.13.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.12.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.11.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.10.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.9.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.8.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.7.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.6.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.5.0 spec/unit/braintree/local_payment_funded_spec.rb
braintree-4.4.0 spec/unit/braintree/local_payment_funded_spec.rb