Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-04-12 00:56:33 +0300
committerblackst0ne <blackst0ne.ru@gmail.com>2017-04-12 00:56:33 +0300
commit9a048a6ea2f0c5aeea0d366ebf715b54664a5f70 (patch)
tree3a2c85708568acdf56ee766d852e73f430bbaaa1 /spec/models
parent01adf920c4da977328c38836327681eb4c52cbee (diff)
Remove heading and trailing spaces from label's color and title
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/label_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb
index a9139f7d4ab..80ca19acdda 100644
--- a/spec/models/label_spec.rb
+++ b/spec/models/label_spec.rb
@@ -42,11 +42,27 @@ describe Label, models: true do
end
end
+ describe '#color' do
+ it 'strips color' do
+ label = described_class.new(color: ' #abcdef ')
+ label.valid?
+
+ expect(label.color).to eq('#abcdef')
+ end
+ end
+
describe '#title' do
it 'sanitizes title' do
label = described_class.new(title: '<b>foo & bar?</b>')
expect(label.title).to eq('foo & bar?')
end
+
+ it 'strips title' do
+ label = described_class.new(title: ' label ')
+ label.valid?
+
+ expect(label.title).to eq('label')
+ end
end
describe 'priorization' do