Sha256: c10c698e8a4454bf3308d7a57ea180db4c39358b3df6f24631bbc380f9f7f076

Contents?: true

Size: 1 KB

Versions: 9

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe BitWallet::Transaction, vcr: true do

  describe 'on initialization' do
    it 'should be able to take a bitcoind hash' do
      wallet = build(:wallet)
      account = wallet.accounts.new('numba')
      address = account.addresses.new('mi3G43CcN')
      args = {"account" => 'numba',
              "address" => "mi3G43CcN",
              "category" => "receive",
              "amount" => 1.5,
              "confirmations" => 0,
              "txid" => "a363e027",
              "time" => 1362239334,
              "timereceived" => 1362239346}
      transaction = described_class.new(wallet, args)
      transaction.account.should == account
      transaction.address.should == address
      transaction.category.should == 'receive'
      transaction.amount.should == 1.5
      transaction.confirmations.should == 0
      transaction.id.should == 'a363e027'
      transaction.occurred_at.to_i.should == 1362239334
      transaction.received_at.to_i.should == 1362239346
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bit_wallet-0.7.1 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.7.0 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.6.1 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.6.0 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.5.0 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.4.0 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.3.0 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.2.0 spec/bit_wallet/transaction_spec.rb
bit_wallet-0.1.1 spec/bit_wallet/transaction_spec.rb