diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-06-16 20:09:13 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-05 20:57:09 -0300 |
commit | e186626d25d5a24e2f2c5f0b5082b79bc8bd0ddf (patch) | |
tree | 05a9fe5ac36515ff1146418875daf9147a285d86 /spec/models/label_spec.rb | |
parent | cfd5870b62e9d76e564ffc64db1d1281b4a363bb (diff) | |
download | gitlab-ce-e186626d25d5a24e2f2c5f0b5082b79bc8bd0ddf.tar.gz |
Allow '?', or '&' for label titles
Diffstat (limited to 'spec/models/label_spec.rb')
-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 |