BigW Consortium Gitlab

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

3
describe Gitlab::GitRefValidator do
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  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 }
25
end