Sha256: 3f218cd5be7b834c47e0349417afbfb3405c74a10ac6f3631c077246f8e52b35

Contents?: true

Size: 923 Bytes

Versions: 9

Compression:

Stored size: 923 Bytes

Contents

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

describe Braintree::SuccessfulResult do
  describe "initialize" do
    it "sets instance variables from the values in the hash" do
      result = Braintree::SuccessfulResult.new(
        :transaction => "transaction_value",
        :credit_card => "credit_card_value",
      )
      expect(result.success?).to eq(true)
      expect(result.transaction).to eq("transaction_value")
      expect(result.credit_card).to eq("credit_card_value")
    end

    it "can be initialized without any values" do
      result = Braintree::SuccessfulResult.new
      expect(result.success?).to eq(true)
    end
  end

  describe "inspect" do
    it "is pretty" do
      result = Braintree::SuccessfulResult.new(:transaction => "transaction_value")
      expect(result.inspect).to eq("#<Braintree::SuccessfulResult transaction:\"transaction_value\">")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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