Step-up auth: Add FactoryBot factory for OmniAuth provider configs
What does this MR do and why?
Reduces duplicated GitlabSettings::Options configuration code across 14 step-up authentication test files. The factory centralizes common configuration patterns, removing ~180 lines of repetitive setup code.
This improves maintainability by providing a single source of truth for test configurations, making future changes easier to implement consistently across all step-up auth tests.
References
- Related issue: #556943
Screenshots or screen recordings
Not applicable - test code refactoring only.
How to set up and validate locally
-
Run the step-up authentication tests:
bundle exec rspec \ spec/factories/omniauth_provider_configs.rb \ spec/lib/gitlab/auth/oidc/omniauth_provider_configs_factory_spec.rb \ spec/controllers/concerns/enforces_step_up_authentication_spec.rb \ spec/controllers/concerns/enforces_step_up_authentication_for_namespace_spec.rb \ spec/controllers/omniauth_callbacks_controller_spec.rb \ spec/helpers/auth_helper_spec.rb \ spec/helpers/groups_helper_spec.rb \ spec/lib/gitlab/auth/oidc/step_up_auth_before_request_phase_spec.rb \ spec/lib/gitlab/auth/oidc/step_up_authentication_flow_spec.rb \ spec/lib/gitlab/auth/oidc/step_up_authentication_spec.rb \ spec/support/shared_examples/enforce_step_up_auth_shared_examples.rb \ spec/views/admin/sessions/new.html.haml_spec.rb -
Verify all 151 tests pass.
-
Review the factory at
spec/factories/omniauth_provider_configs.rbfor the centralized configuration patterns.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.