BigW Consortium Gitlab

git_ref_validator_spec.rb 1.3 KB
Newer Older
1 2
require 'spec_helper'

Douwe Maan committed
3
describe Gitlab::GitRefValidator, lib: true do
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  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 }
20
end