mirror of
https://github.com/we-promise/sure.git
synced 2026-05-25 13:34:58 +00:00
* 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
27 lines
813 B
Ruby
27 lines
813 B
Ruby
require "test_helper"
|
|
|
|
class IbkrItem::SyncerTest < ActiveSupport::TestCase
|
|
fixtures :families, :ibkr_items
|
|
|
|
setup do
|
|
@ibkr_item = ibkr_items(:configured_item)
|
|
end
|
|
|
|
test "perform_sync records a single auth error when credentials are missing" do
|
|
@ibkr_item.update!(token: nil)
|
|
syncer = IbkrItem::Syncer.new(@ibkr_item)
|
|
sync = @ibkr_item.syncs.create!
|
|
|
|
error = assert_raises(Provider::IbkrFlex::ConfigurationError) do
|
|
syncer.perform_sync(sync)
|
|
end
|
|
|
|
assert_equal "IBKR credentials are missing.", error.message
|
|
assert_equal "requires_update", @ibkr_item.reload.status
|
|
|
|
stats = sync.reload.sync_stats
|
|
assert_equal 1, stats["total_errors"]
|
|
assert_equal [ { "message" => "IBKR credentials are missing.", "category" => "auth_error" } ], stats["errors"]
|
|
end
|
|
end
|