mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
Fix price sync
This commit is contained in:
parent
0fbafceea9
commit
7988ab64cc
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ class MarketDataSyncer
|
||||||
Rails.logger.info("Syncing security price for: #{security.ticker}, start_date: #{start_date}, end_date: #{end_date}")
|
Rails.logger.info("Syncing security price for: #{security.ticker}, start_date: #{start_date}, end_date: #{end_date}")
|
||||||
|
|
||||||
fetched_prices = price_provider.fetch_security_prices(
|
fetched_prices = price_provider.fetch_security_prices(
|
||||||
security.ticker,
|
security,
|
||||||
start_date: start_date,
|
start_date: start_date,
|
||||||
end_date: end_date
|
end_date: end_date
|
||||||
)
|
)
|
||||||
|
|
|
@ -54,7 +54,7 @@ class MarketDataSyncerTest < ActiveSupport::TestCase
|
||||||
end_date = Date.current.in_time_zone("America/New_York").to_date
|
end_date = Date.current.in_time_zone("America/New_York").to_date
|
||||||
|
|
||||||
mock_provider.expects(:fetch_security_prices)
|
mock_provider.expects(:fetch_security_prices)
|
||||||
.with("AAPL", start_date: start_date, end_date: end_date)
|
.with(aapl, start_date: start_date, end_date: end_date)
|
||||||
.returns(provider_success_response([ OpenStruct.new(security: aapl, date: start_date, price: 100, currency: "USD") ]))
|
.returns(provider_success_response([ OpenStruct.new(security: aapl, date: start_date, price: 100, currency: "USD") ]))
|
||||||
|
|
||||||
assert_difference "Security::Price.count", 1 do
|
assert_difference "Security::Price.count", 1 do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue