Fix specs in GroupsController's 'setting disable_personal_access_tokens'
What does this MR do and why?
Currently GroupsController's specs in 'setting disable_personal_access_tokens' context do not provide good test coverage for the related implementation. For instance, if remove related condition from the application code
diff --git ee/app/controllers/concerns/ee/groups/params.rb ee/app/controllers/concerns/ee/groups/params.rb
index 48b571c26abe..54bfa508fe70 100644
--- ee/app/controllers/concerns/ee/groups/params.rb
+++ ee/app/controllers/concerns/ee/groups/params.rb
@@ -74,7 +74,7 @@ def group_params_ee
duo_sast_fp_detection_enabled lock_duo_sast_fp_detection_enabled])
end
- params_ee << :disable_personal_access_tokens if current_group&.disable_personal_access_tokens_available?
+ params_ee << :disable_personal_access_tokens
params_ee << :disable_ssh_keys if current_group&.disable_ssh_keys_available?
if current_group&.can_manage_extensions_marketplace_for_enterprise_users?
all specs within this context will still pass because we use Group#disable_personal_access_tokens? method there; that method always checks whether this feature is available. To assert that this setting is/is not changed in the database, we should use group.namespace_settings.disable_personal_access_tokens instead. This will improve coverage.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
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.
Edited by Bogdan Denkovych