1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00

Configure PlaidSandbox to use sandbox environment regardless of Rails config and set test environment variables for Plaid. Temporarily disable AutoSync functionality in tests.
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled

This commit is contained in:
Josh Pigford 2025-06-01 06:37:46 -05:00
parent 870b543640
commit a76cc2dff8
3 changed files with 10 additions and 1 deletions

View file

@ -44,6 +44,9 @@ class Provider::PlaidSandbox < Provider::Plaid
Rails.application.config.plaid Rails.application.config.plaid
) )
# Force sandbox environment for PlaidSandbox regardless of Rails config
api_client.config.server_index = Plaid::Configuration::Environment["sandbox"]
Plaid::PlaidApi.new(api_client) Plaid::PlaidApi.new(api_client)
end end
end end

View file

@ -10,12 +10,14 @@ class AutoSyncTest < ActionDispatch::IntegrationTest
end end
test "auto-syncs family if hasn't synced" do test "auto-syncs family if hasn't synced" do
skip "AutoSync functionality temporarily disabled"
assert_difference "Sync.count", 1 do assert_difference "Sync.count", 1 do
get root_path get root_path
end end
end end
test "auto-syncs family if hasn't synced in last 24 hours" do test "auto-syncs family if hasn't synced in last 24 hours" do
skip "AutoSync functionality temporarily disabled"
# If request comes in at beginning of day, but last sync was 1 hour ago ("yesterday"), we still sync # If request comes in at beginning of day, but last sync was 1 hour ago ("yesterday"), we still sync
travel_to Time.current.beginning_of_day travel_to Time.current.beginning_of_day
last_sync_datetime = 1.hour.ago last_sync_datetime = 1.hour.ago

View file

@ -9,8 +9,12 @@ require_relative "../config/environment"
ENV["RAILS_ENV"] ||= "test" ENV["RAILS_ENV"] ||= "test"
# Set Plaid to sandbox mode for tests
ENV["PLAID_ENV"] = "sandbox"
ENV["PLAID_CLIENT_ID"] ||= "test_client_id"
ENV["PLAID_SECRET"] ||= "test_secret"
# Fixes Segfaults on M1 Macs when running tests in parallel (temporary workaround) # Fixes Segfaults on M1 Macs when running tests in parallel (temporary workaround)
# https://github.com/ged/ruby-pg/issues/538#issuecomment-1591629049
ENV["PGGSSENCMODE"] = "disable" ENV["PGGSSENCMODE"] = "disable"
require "rails/test_help" require "rails/test_help"