2014-07-08 15:15:23 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Regex do
|
2015-03-24 15:58:44 +00:00
|
|
|
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) }
|
2014-07-08 15:15:23 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'project name regex' do
|
2015-02-12 18:17:35 +00:00
|
|
|
it { expect('gitlab-ce').to match(Gitlab::Regex.project_name_regex) }
|
|
|
|
it { expect('GitLab CE').to match(Gitlab::Regex.project_name_regex) }
|
|
|
|
it { expect('100 lines').to match(Gitlab::Regex.project_name_regex) }
|
|
|
|
it { expect('gitlab.git').to match(Gitlab::Regex.project_name_regex) }
|
|
|
|
it { expect('?gitlab').not_to match(Gitlab::Regex.project_name_regex) }
|
2014-07-08 15:15:23 +00:00
|
|
|
end
|
|
|
|
end
|