Sha256: f9f764cd84ac14ab6cb74136a8ba1ea76f0ddef2a6c0895337d408262c067cf9

Contents?: true

Size: 875 Bytes

Versions: 4

Compression:

Stored size: 875 Bytes

Contents

require "test_helper"
require "acceptance_test"

class BankTransfer < Test::Unit::TestCase
  include AcceptanceTest

  let :client do
    Xeroizer::PrivateApplication.new(@consumer_key, @consumer_secret, @key_file)
  end

  def setup
    super
    all_accounts = client.Account.all
    @from_bank_account = all_accounts.select { |acct| acct.status == "ACTIVE" && acct.type == "BANK" }.first
    @to_bank_account = all_accounts.select { |acct| acct.status == "ACTIVE" && acct.type == "BANK" }.last
  end

  can "create a bank transfer" do
    new_transfer = client.BankTransfer.build(
      :amount => 300,
      :from_bank_account => { :account_id => @from_bank_account.account_id },
      :to_bank_account => { :account_id => @to_bank_account.account_id }
    )
    assert new_transfer.save, "Save failed with the following errors: #{new_transfer.errors.inspect}"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xeroizer-2.20.0 test/acceptance/bank_transfer_test.rb
xeroizer-2.19.0 test/acceptance/bank_transfer_test.rb
xeroizer-2.18.1 test/acceptance/bank_transfer_test.rb
xeroizer-2.17.1 test/acceptance/bank_transfer_test.rb