mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 13:05:19 +02:00
Security resolver and health checker (#2281)
* Setup health check * Security health checker cron * Use resolver throughout codebase * Use resolver for trade builder * Add security health checks to schedule * Handle no provider * Lint fixes
This commit is contained in:
parent
857436d894
commit
e4ee06c9f6
19 changed files with 599 additions and 78 deletions
|
@ -43,7 +43,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
with_provider_response = provider_error_response(StandardError.new("Test error"))
|
||||
|
||||
@provider.expects(:fetch_security_price)
|
||||
.with(security, date: Date.current)
|
||||
.with(symbol: security.ticker, exchange_operating_mic: security.exchange_operating_mic, date: Date.current)
|
||||
.returns(with_provider_response)
|
||||
|
||||
assert_not @security.find_or_fetch_price(date: Date.current)
|
||||
|
@ -52,7 +52,7 @@ class Security::PriceTest < ActiveSupport::TestCase
|
|||
private
|
||||
def expect_provider_price(security:, price:, date:)
|
||||
@provider.expects(:fetch_security_price)
|
||||
.with(security, date: date)
|
||||
.with(symbol: security.ticker, exchange_operating_mic: security.exchange_operating_mic, date: date)
|
||||
.returns(provider_success_response(price))
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue