mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
28 lines
662 B
Ruby
28 lines
662 B
Ruby
|
require "test_helper"
|
||
|
|
||
|
class ProvidersTest < ActiveSupport::TestCase
|
||
|
test "synth configured with ENV" do
|
||
|
Setting.stubs(:synth_api_key).returns(nil)
|
||
|
|
||
|
with_env_overrides SYNTH_API_KEY: "123" do
|
||
|
assert_instance_of Provider::Synth, Providers.synth
|
||
|
end
|
||
|
end
|
||
|
|
||
|
test "synth configured with Setting" do
|
||
|
Setting.stubs(:synth_api_key).returns("123")
|
||
|
|
||
|
with_env_overrides SYNTH_API_KEY: nil do
|
||
|
assert_instance_of Provider::Synth, Providers.synth
|
||
|
end
|
||
|
end
|
||
|
|
||
|
test "synth not configured" do
|
||
|
Setting.stubs(:synth_api_key).returns(nil)
|
||
|
|
||
|
with_env_overrides SYNTH_API_KEY: nil do
|
||
|
assert_nil Providers.synth
|
||
|
end
|
||
|
end
|
||
|
end
|