mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Format money for trade history in holdings drawer (#1961)
* Format money for trade history in holdings drawer * Fix broken tests * Lint fix
This commit is contained in:
parent
86bf47a32e
commit
a3cd5f4f1d
4 changed files with 14 additions and 7 deletions
|
@ -33,7 +33,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
tomorrow = Date.current + 1.day
|
||||
|
||||
@provider.expects(:fetch_security_prices)
|
||||
.with(ticker: security.ticker, mic_code: security.exchange_mic, start_date: tomorrow, end_date: tomorrow)
|
||||
.with(ticker: security.ticker, mic_code: security.exchange_operating_mic, start_date: tomorrow, end_date: tomorrow)
|
||||
.once
|
||||
.returns(
|
||||
OpenStruct.new(
|
||||
|
@ -54,7 +54,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
Security::Price.delete_all # Clear any existing prices
|
||||
|
||||
@provider.expects(:fetch_security_prices)
|
||||
.with(ticker: security.ticker, mic_code: security.exchange_mic, start_date: Date.current, end_date: Date.current)
|
||||
.with(ticker: security.ticker, mic_code: security.exchange_operating_mic, start_date: Date.current, end_date: Date.current)
|
||||
.once
|
||||
.returns(OpenStruct.new(success?: false))
|
||||
|
||||
|
@ -91,7 +91,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
|
||||
@provider.expects(:fetch_security_prices)
|
||||
.with(ticker: security.ticker,
|
||||
mic_code: security.exchange_mic,
|
||||
mic_code: security.exchange_operating_mic,
|
||||
start_date: 2.days.ago.to_date,
|
||||
end_date: 2.days.ago.to_date)
|
||||
.returns(OpenStruct.new(success?: true, prices: [ { date: 2.days.ago.to_date, price: missing_price, currency: "USD" } ]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue