Files
sure/test/models/account_ibkr_creation_test.rb
Gian-Reto Tarnutzer ce5d7dd736 Add Interactive Brokers Provider (#1722)
* Display multi-currency holdings correctly

* Implement IBKR provider

* Fix: Use historical exchange rate for historical prices

* Add brokerage exchange rate for trades

* Sync historical balances from IBKR

* Add logos in activity history

* Fix privacy mode blur in account view

* Improve IBKR XML Flex report parser errors
2026-05-12 23:45:19 +02:00

31 lines
938 B
Ruby

require "test_helper"
class AccountIbkrCreationTest < ActiveSupport::TestCase
fixtures :families, :ibkr_items, :ibkr_accounts
test "uses interactive brokers account id as part of the default name" do
ibkr_account = ibkr_accounts(:main_account)
account = Account.create_from_ibkr_account(ibkr_account)
assert_equal "Interactive Brokers (U1234567)", account.name
assert_equal "Investment", account.accountable_type
assert_equal "CHF", account.currency
end
test "falls back to provider name when ibkr account id is missing" do
family = families(:empty)
ibkr_item = ibkr_items(:empty_item)
ibkr_account = ibkr_item.ibkr_accounts.create!(
name: "Imported IBKR Account",
ibkr_account_id: nil,
currency: "USD"
)
account = Account.create_from_ibkr_account(ibkr_account)
assert_equal "Interactive Brokers", account.name
assert_equal family, account.family
end
end