mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 23:25:00 +00:00
Add exchange rate feature with multi-currency transactions and transfers support (#1099)
Co-authored-by: Pedro J. Aramburu <pedro@joakin.dev>
This commit is contained in:
committed by
GitHub
parent
8e81e967fc
commit
f699660479
@@ -58,8 +58,9 @@ class HoldingTest < ActiveSupport::TestCase
|
||||
nvda_qty = BigDecimal("5") + BigDecimal("30")
|
||||
expected_nvda_usd = nvda_total_usd / nvda_qty
|
||||
|
||||
assert_equal Money.new(expected_amzn_usd, "CAD").exchange_to("USD", fallback_rate: 1), @amzn.avg_cost
|
||||
assert_equal Money.new(expected_nvda_usd, "CAD").exchange_to("USD", fallback_rate: 1), @nvda.avg_cost
|
||||
ExchangeRate.stubs(:find_or_fetch_rate).returns(OpenStruct.new(rate: 1))
|
||||
assert_equal Money.new(expected_amzn_usd, "CAD").exchange_to("USD"), @amzn.avg_cost
|
||||
assert_equal Money.new(expected_nvda_usd, "CAD").exchange_to("USD"), @nvda.avg_cost
|
||||
end
|
||||
|
||||
test "calculates total return trend" do
|
||||
|
||||
Reference in New Issue
Block a user