Skip to content

DRY api/users_spec deactivation tests

Serena Fang requested to merge dry-user-spec-deactivate into master

What does this MR do?

Uses subject { post api("/users/#{user.id}/deactivate", api_user) } instead of use post multiple times.

Note: spec/requests/api/users_spec.rb:2452 context 'for an internal user' do is blocked by !43356 (merged), which changes the return code from 201 to 403. So currently it'll fail with expected the response to have status code :forbidden but it was 201. The response was: false but once !43356 (merged) lands I'll do a rebase and it should pass.

Similar to !44057 (merged)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Serena Fang

Merge request reports

Loading