2015-04-26 12:48:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
describe Gitlab::GitRefValidator, lib: true do
|
2015-04-26 12:48:37 +05:30
|
|
|
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
|