mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Add validation to security price model
This commit is contained in:
parent
cd91e66618
commit
c9917674aa
3 changed files with 5 additions and 3 deletions
|
@ -36,7 +36,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
.returns(
|
||||
OpenStruct.new(
|
||||
success?: true,
|
||||
prices: [ { date: tomorrow, price: expected_price } ]
|
||||
prices: [ { date: tomorrow, price: expected_price, currency: "USD" } ]
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -89,7 +89,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
mic_code: security.exchange_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 } ]))
|
||||
.returns(OpenStruct.new(success?: true, prices: [ { date: 2.days.ago.to_date, price: missing_price, currency: "USD" } ]))
|
||||
.once
|
||||
|
||||
price1 = security_prices(:one) # AAPL today
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue