Sha256: a39ebd7c1c1a7d397efa52b4f85db77e1157887de2d260b41aa9f04a1a2a07f0

Contents?: true

Size: 1.32 KB

Versions: 9

Compression:

Stored size: 1.32 KB

Contents

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

describe Braintree::LocalPaymentCompleted do
  describe "self.new" do
    it "is protected" do
      expect do
        Braintree::LocalPaymentCompleted.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",
        payer_id: "a-payer-id",
        payment_method_nonce: "a-nonce",
        transaction: {
          id: "a-transaction-id",
          amount: "31.00",
          order_id: "an-order-id",
          status: Braintree::Transaction::Status::Authorized,
        },
      }
      local_payment_completed = Braintree::LocalPaymentCompleted._new(params)

      local_payment_completed.payment_id.should eq("a-payment-id")
      local_payment_completed.payer_id.should eq("a-payer-id")
      local_payment_completed.payment_method_nonce.should eq("a-nonce")
      local_payment_completed.transaction.id.should eq("a-transaction-id")
      local_payment_completed.transaction.amount.should eq(31.0)
      local_payment_completed.transaction.order_id.should eq("an-order-id")
      local_payment_completed.transaction.status.should eq(Braintree::Transaction::Status::Authorized)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
braintree-2.104.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.103.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.102.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.101.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.100.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.99.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.98.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.97.0 spec/unit/braintree/local_payment_completed_spec.rb
braintree-2.96.0 spec/unit/braintree/local_payment_completed_spec.rb