Sha256: 9c23e835b251e40cd3b01bf2120aaa7978ade8a514c19a106af0de45a1c03331

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

module BitWallet
  describe Accounts, vcr: {record: :once}, bitcoin_cleaner: true do

    let(:wallet) do
      build(:wallet)
    end

    subject do
      Accounts.new(wallet)
    end

    its(:wallet) { should == wallet }

    describe '#new' do
      it 'should create a new BitWallet::Account with a default address' do
        account = wallet.accounts.new('accountname')
        account.should be_kind_of(Account)
        account.addresses.count.should == 1
      end
    end

    describe '.with_balance' do
      it 'should return accounts with a balance > 0' do
        default_account = subject.new('')
        account_1 = subject.new('nomoney')
        account_2 = subject.new('moneyd')

        default_account.send_amount 5, to: account_2.addresses.first

        accounts_with_balance = subject.with_balance
        accounts_with_balance.should include(default_account)
        accounts_with_balance.should_not include(account_1)
        accounts_with_balance.should include(account_2)
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bit_wallet-0.7.6 spec/bit_wallet/accounts_spec.rb
bit_wallet-0.7.5 spec/bit_wallet/accounts_spec.rb
bit_wallet-0.7.3 spec/bit_wallet/accounts_spec.rb