Skip to content
Snippets Groups Projects
Commit 1d829ca1 authored by Douwe Maan's avatar Douwe Maan
Browse files

Fix tests.

parent 5f93b0e3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -74,7 +74,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
 
step 'I fill the new file name with an illegal name' do
fill_in :file_name, with: '.git'
fill_in :file_name, with: 'Spaces Not Allowed'
end
 
step 'I fill the commit message' do
Loading
Loading
require 'spec_helper'
 
describe Gitlab::Regex do
describe 'path regex' do
it { expect('gitlab-ce').to match(Gitlab::Regex.path_regex) }
it { expect('gitlab_git').to match(Gitlab::Regex.path_regex) }
it { expect('_underscore.js').to match(Gitlab::Regex.path_regex) }
it { expect('100px.com').to match(Gitlab::Regex.path_regex) }
it { expect('?gitlab').not_to match(Gitlab::Regex.path_regex) }
it { expect('git lab').not_to match(Gitlab::Regex.path_regex) }
it { expect('gitlab.git').not_to match(Gitlab::Regex.path_regex) }
describe 'project path regex' do
it { expect('gitlab-ce').to match(Gitlab::Regex.project_path_regex) }
it { expect('gitlab_git').to match(Gitlab::Regex.project_path_regex) }
it { expect('_underscore.js').to match(Gitlab::Regex.project_path_regex) }
it { expect('100px.com').to match(Gitlab::Regex.project_path_regex) }
it { expect('?gitlab').not_to match(Gitlab::Regex.project_path_regex) }
it { expect('git lab').not_to match(Gitlab::Regex.project_path_regex) }
it { expect('gitlab.git').not_to match(Gitlab::Regex.project_path_regex) }
end
 
describe 'project name regex' do
Loading
Loading
Loading
Loading
@@ -252,7 +252,7 @@ describe API::API, api: true do
expect(json_response['message']['path']).to eq([
'can\'t be blank',
'is too short (minimum is 0 characters)',
Gitlab::Regex.send(:default_regex_message)
Gitlab::Regex.send(:project_path_regex_message)
])
end
 
Loading
Loading
Loading
Loading
@@ -140,7 +140,7 @@ describe API::API, api: true do
expect(json_response['message']['projects_limit']).
to eq(['must be greater than or equal to 0'])
expect(json_response['message']['username']).
to eq([Gitlab::Regex.send(:default_regex_message)])
to eq([Gitlab::Regex.send(:namespace_regex_message)])
end
 
it "shouldn't available for non admin users" do
Loading
Loading
@@ -266,7 +266,7 @@ describe API::API, api: true do
expect(json_response['message']['projects_limit']).
to eq(['must be greater than or equal to 0'])
expect(json_response['message']['username']).
to eq([Gitlab::Regex.send(:default_regex_message)])
to eq([Gitlab::Regex.send(:namespace_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.
Finish editing this message first!
Please register or to comment