Skip to content
Snippets Groups Projects
Commit 98db90c4 authored by Ciro Santilli's avatar Ciro Santilli
Browse files

Factor regex error messages with spec API tests

parent f9814bf2
No related branches found
No related tags found
Loading
Loading
Loading
@@ -203,14 +203,12 @@ describe API::API, api: true do
json_response['message']['name'].should == [
'can\'t be blank',
'is too short (minimum is 0 characters)',
'can contain only letters, digits, \'_\', \'-\' and \'.\' and '\
'space. It must start with letter, digit or \'_\'.'
Gitlab::Regex.project_regex_message
]
json_response['message']['path'].should == [
'can\'t be blank',
'is too short (minimum is 0 characters)',
'can contain only letters, digits, \'_\', \'-\' and \'.\'. ' \
'Cannot start with \'-\' or end in \'.git\''
Gitlab::Regex.send(:default_regex_message)
]
end
 
Loading
Loading
Loading
Loading
@@ -140,8 +140,7 @@ describe API::API, api: true do
json_response['message']['projects_limit'].
should == ['must be greater than or equal to 0']
json_response['message']['username'].
should == ['can contain only letters, digits, '\
'\'_\', \'-\' and \'.\'. Cannot start with \'-\' or end in \'.git\'']
should == [Gitlab::Regex.send(:default_regex_message)]
end
 
it "shouldn't available for non admin users" do
Loading
Loading
@@ -283,8 +282,7 @@ describe API::API, api: true do
json_response['message']['projects_limit'].
should == ['must be greater than or equal to 0']
json_response['message']['username'].
should == ['can contain only letters, digits, '\
'\'_\', \'-\' and \'.\'. Cannot start with \'-\' or end in \'.git\'']
should == [Gitlab::Regex.send(:default_regex_message)]
end
 
context "with existing user" do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment