2014-07-27 14:40:00 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 14:24:02 +00:00
|
|
|
describe Gitlab::GitRefValidator do
|
2017-07-25 17:09:00 +00:00
|
|
|
it { expect(described_class.validate('feature/new')).to be_truthy }
|
|
|
|
it { expect(described_class.validate('implement_@all')).to be_truthy }
|
|
|
|
it { expect(described_class.validate('my_new_feature')).to be_truthy }
|
|
|
|
it { expect(described_class.validate('#1')).to be_truthy }
|
|
|
|
it { expect(described_class.validate('feature/refs/heads/foo')).to be_truthy }
|
|
|
|
it { expect(described_class.validate('feature/~new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/^new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/:new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/?new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/*new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/[new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/new/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature/new.')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature\@{')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature\new')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature//new')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('feature new')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('refs/heads/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('refs/remotes/')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('refs/heads/feature')).to be_falsey }
|
|
|
|
it { expect(described_class.validate('refs/remotes/origin')).to be_falsey }
|
2014-07-27 14:40:00 +00:00
|
|
|
end
|