push_rule_branch_name: "Branch name does not follow the pattern '%{branch_name_regex}'",
push_rule_committer_not_verified: "Comitter email '%{commiter_email}' is not verified.",
push_rule_committer_not_allowed: "You cannot push commits for '%{committer_email}'. You can only push commits that were committed with one of your own verified emails."
push_code: 'You are not allowed to push code to this project.',
...
...
@@ -16,14 +15,10 @@ module Gitlab
update_protected_tag: 'Protected tags cannot be updated.',
delete_protected_tag: 'Protected tags cannot be deleted.',
create_protected_tag: 'You are not allowed to create this tag as it is protected.',
lfs_objects_missing: 'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".',
push_rule_branch_name: "Branch name does not follow the pattern '%{branch_name_regex}'",
push_rule_committer_not_verified: "Comitter email '%{commiter_email}' is not verified.",
push_rule_committer_not_allowed: "You cannot push commits for '%{committer_email}'. You can only push commits that were committed with one of your own verified emails."
lfs_objects_missing: 'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".'
it_behaves_like'check ignored when push rule unlicensed'
it'returns an error if the rule fails'do
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,"Commit message does not follow the pattern '#{push_rule.commit_message_regex}'")
end
it'returns an error if the regex is invalid'do
push_rule.commit_message_regex='+'
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,/\ARegular expression '\+' is invalid/)
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,"Committer's email 'ana@invalid.com' does not follow the pattern '.*@valid.com'")
end
it'returns an error if the rule fails for the author'do
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,"Author's email 'joan@invalid.com' does not follow the pattern '.*@valid.com'")
end
it'returns an error if the regex is invalid'do
push_rule.author_email_regex='+'
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,/\ARegular expression '\+' is invalid/)
it_behaves_like'check ignored when push rule unlicensed'
it'returns an error if the rule fails'do
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,"Commit message does not follow the pattern '#{push_rule.commit_message_regex}'")
end
it'returns an error if the regex is invalid'do
push_rule.commit_message_regex='+'
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,/\ARegular expression '\+' is invalid/)
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,"Committer's email 'ana@invalid.com' does not follow the pattern '.*@valid.com'")
end
it'returns an error if the rule fails for the author'do
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,"Author's email 'joan@invalid.com' does not follow the pattern '.*@valid.com'")
end
it'returns an error if the regex is invalid'do
push_rule.author_email_regex='+'
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,/\ARegular expression '\+' is invalid/)