diff options
author | Robert Speicher <robert@gitlab.com> | 2016-07-06 18:11:20 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-07-06 18:11:20 +0300 |
commit | 3df58f149979f98af9b52c9e08dd63d17344d1df (patch) | |
tree | d36a3cda8139af4bebd8ea37530e9b67c3fff619 /spec/models | |
parent | be018ba8c4f61babfea494a3946df9931d476a8a (diff) | |
parent | e89a515ce953a6805d512e005cef4034b337c182 (diff) |
Merge branch 'gh-labels' into 'master'
Allow `?`, or `&` for label names
Closes #18727
See merge request !4724
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/label_spec.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb index dad2628651b..f37f44a608e 100644 --- a/spec/models/label_spec.rb +++ b/spec/models/label_spec.rb @@ -32,21 +32,20 @@ describe Label, models: true do it 'should validate title' do expect(label).not_to allow_value('G,ITLAB').for(:title) - expect(label).not_to allow_value('G?ITLAB').for(:title) - expect(label).not_to allow_value('G&ITLAB').for(:title) expect(label).not_to allow_value('').for(:title) expect(label).to allow_value('GITLAB').for(:title) expect(label).to allow_value('gitlab').for(:title) + expect(label).to allow_value('G?ITLAB').for(:title) + expect(label).to allow_value('G&ITLAB').for(:title) expect(label).to allow_value("customer's request").for(:title) end end - describe "#title" do - let(:label) { create(:label, title: "<b>test</b>") } - - it "sanitizes title" do - expect(label.title).to eq("test") + describe '#title' do + it 'sanitizes title' do + label = described_class.new(title: '<b>foo & bar?</b>') + expect(label.title).to eq('foo & bar?') end end |