Skip to content

RSpec access matcher: Remove patched user after matcher is run

What does this MR do?

The first error is expected this action to be allowed for admin role. Expected status code: any of 200, 201, 204, 302, 304 Got: 500 but then the second error is due to rspec-retry which doesn't unset :@__#{USER_ACCESSOR_METHOD_NAME}_patched instance variable: https://gitlab.com/gitlab-org/gitlab/-/blob/6e7e449dba65077aca8faabc63848ebdcf662444/spec/support/helpers/access_matchers_helpers.rb#L64-66

This MR cleans up the user patch after the matcher is run, so that we don't have issues when the matcher runs multiple times in an example group.

Related to #332442 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Alishan Ladhani

Merge request reports

Loading