Fix hardcoded ids in projects API tests
What does this MR do?
This MR fixes the hardcoded ids in projects API tests and fixes random test failures.
Example pipeline error:
1) API::Projects GET /projects/:id when authenticated as a regular user returns a 404 error if not found
Failure/Error: expect(response).to have_gitlab_http_status(:not_found)
expected the response to have status code :not_found but it was 200. The response was: {"id":42,"description":null,"name":"second_project","name_with_namespace":"John Doe171 / second_project","path":"second_project","path_with_namespace":"user219/second_project","created_at":"2021-02-01T13:17:43.310Z","default_bran
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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 Alex Kalderimis