Refactor checking personal project limits
What does this MR do?
This refactors the code used for checking if a user has exceeded the personal projects limit. As part of this refactor the method has been renamed from Project#check_limit to "check_personal_projects_limit", as this name makes it much more clear what the purpose of the method is. Standalone unit tests have also been added, as before we only had a single generic validation test that did not cover all cases.
The old implementation of the refactored method also included a rescue
statement. This code would only run when a project creator was not set.
The error that would be added wasn't super useful, especially since
there would already be errors for the creator not being present. As none
of the other code in the "check_personal_projects_limit" raises, it has
been removed.
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/release/framework/issues/108
Does this MR meet the acceptance criteria?
-
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Security reports checked/validated by reviewer