mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
The suspend user modal lists other accounts sharing the same IP address, with a checkbox next to each so staff can penalize them in the same action. Since #41227, every one of those checkboxes was disabled, making it impossible to select anyone. The modal enables a checkbox only when the user's `can_be_suspended` attribute is `true` in the similar-users response. That attribute regressed as a side effect of #41227: it added `can_be_suspended` to the parent `AdminUserListSerializer` behind an `include_can_be_suspended?` opt-in guard for the admin users list. `SimilarAdminUserSerializer` inherited that guard, and since the similar-users endpoint never passes the opt-in option, the attribute was silently dropped from its response — and a missing attribute reads as "cannot be suspended", disabling the checkbox. This change overrides the guard in `SimilarAdminUserSerializer` so the attribute is always serialized, as it was before. It also adds a request spec pinning `can_be_suspended`/`can_be_silenced` in the response, and extends the suspend system spec to tick a similar user's checkbox and verify both accounts get suspended — closing the coverage gap that let this regress unnoticed. |
||
|---|---|---|
| .. | ||
| config | ||
| admin_controller_spec.rb | ||
| api_controller_spec.rb | ||
| backups_controller_spec.rb | ||
| badges_controller_spec.rb | ||
| color_schemes_controller_spec.rb | ||
| dashboard_controller_spec.rb | ||
| email_controller_spec.rb | ||
| email_logs_controller_spec.rb | ||
| email_styles_controller_spec.rb | ||
| email_templates_controller_spec.rb | ||
| embeddable_hosts_controller_spec.rb | ||
| embedding_controller_spec.rb | ||
| emojis_controller_spec.rb | ||
| form_templates_controller_spec.rb | ||
| groups_controller_spec.rb | ||
| impersonate_controller_spec.rb | ||
| permalinks_controller_spec.rb | ||
| plugins_controller_spec.rb | ||
| problem_checks_controller_spec.rb | ||
| reports_controller_spec.rb | ||
| robots_txt_controller_spec.rb | ||
| screened_emails_controller_spec.rb | ||
| screened_ip_addresses_controller_spec.rb | ||
| screened_urls_controller_spec.rb | ||
| search_controller_spec.rb | ||
| search_logs_spec.rb | ||
| site_settings_controller_spec.rb | ||
| site_texts_controller_spec.rb | ||
| staff_action_logs_controller_spec.rb | ||
| themes_controller_spec.rb | ||
| unknown_reviewables_controller_spec.rb | ||
| user_fields_controller_spec.rb | ||
| users_controller_spec.rb | ||
| versions_controller_spec.rb | ||
| watched_words_controller_spec.rb | ||
| web_hooks_controller_spec.rb | ||