1
0
Fork 0
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:
Zach Gollwitzer 2024-10-30 09:51:05 -04:00
parent cd91e66618
commit c9917674aa
3 changed files with 5 additions and 3 deletions

View file

@ -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