Files
sure/test/lib/feature_flags_test.rb
Copilot 1527611239 Default production SSO provider source to YAML to avoid boot-time schema errors (#1278)
* Initial plan

* Default production SSO provider source to YAML

Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
Agent-Logs-Url: https://github.com/we-promise/sure/sessions/d3a36ca8-e936-4687-a466-9b4c93c19150

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
2026-03-25 15:08:36 +01:00

27 lines
981 B
Ruby

require "test_helper"
class FeatureFlagsTest < ActiveSupport::TestCase
test "db_sso_providers? is true when AUTH_PROVIDERS_SOURCE is db in production" do
with_env_overrides("AUTH_PROVIDERS_SOURCE" => "db") do
Rails.stubs(:env).returns(ActiveSupport::StringInquirer.new("production"))
assert FeatureFlags.db_sso_providers?
end
end
test "db_sso_providers? defaults to yaml in production when AUTH_PROVIDERS_SOURCE is unset" do
with_env_overrides("AUTH_PROVIDERS_SOURCE" => nil) do
Rails.stubs(:env).returns(ActiveSupport::StringInquirer.new("production"))
assert_not FeatureFlags.db_sso_providers?
end
end
test "db_sso_providers? defaults to db for self hosted mode outside production" do
with_env_overrides("AUTH_PROVIDERS_SOURCE" => nil) do
Rails.stubs(:env).returns(ActiveSupport::StringInquirer.new("development"))
with_self_hosting do
assert FeatureFlags.db_sso_providers?
end
end
end
end