Mercury integration (#723)

* Initial mercury impl

* FIX both mercury and generator class

* Finish mercury integration and provider generator

* Fix schema

* Fix linter and tags

* Update routes.rb

* Avoid schema drift

---------

Signed-off-by: soky srm <sokysrm@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
soky srm
2026-01-22 20:37:07 +01:00
committed by GitHub
parent 7842b4a044
commit 179552657c
46 changed files with 3345 additions and 30 deletions

View File

@@ -0,0 +1,38 @@
require "test_helper"
class Provider::MercuryAdapterTest < ActiveSupport::TestCase
test "supports Depository accounts" do
assert_includes Provider::MercuryAdapter.supported_account_types, "Depository"
end
test "does not support Investment accounts" do
assert_not_includes Provider::MercuryAdapter.supported_account_types, "Investment"
end
test "returns connection configs for any family" do
# Mercury is a per-family provider - any family can connect
family = families(:dylan_family)
configs = Provider::MercuryAdapter.connection_configs(family: family)
assert_equal 1, configs.length
assert_equal "mercury", configs.first[:key]
assert_equal "Mercury", configs.first[:name]
assert configs.first[:can_connect]
end
test "build_provider returns nil when family is nil" do
assert_nil Provider::MercuryAdapter.build_provider(family: nil)
end
test "build_provider returns nil when family has no mercury items" do
family = families(:empty)
assert_nil Provider::MercuryAdapter.build_provider(family: family)
end
test "build_provider returns Mercury provider when credentials configured" do
family = families(:dylan_family)
provider = Provider::MercuryAdapter.build_provider(family: family)
assert_instance_of Provider::Mercury, provider
end
end