Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git_ref_validator_spec.rb « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4633b6f3934b9ddf7e00c1cf3ea35e10d3da9f57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe Gitlab::GitRefValidator do
  it { expect(Gitlab::GitRefValidator.validate('feature/new')).to be_truthy }
  it { expect(Gitlab::GitRefValidator.validate('implement_@all')).to be_truthy }
  it { expect(Gitlab::GitRefValidator.validate('my_new_feature')).to be_truthy }
  it { expect(Gitlab::GitRefValidator.validate('#1')).to be_truthy }
  it { expect(Gitlab::GitRefValidator.validate('feature/~new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/^new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/:new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/?new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/*new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/[new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/new/')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature/new.')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature\@{')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature\new')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature//new')).to be_falsey }
  it { expect(Gitlab::GitRefValidator.validate('feature new')).to be_falsey }
end