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
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-05-25 21:50:02 +0300
committerTimothy Andrew <mail@timothyandrew.net>2017-06-08 13:19:19 +0300
commitd9b4e4c8651367d13700eadeb5cedd6dd36db9f5 (patch)
tree42062ec1830893d6ce4bc345c4c29dca77be2b85 /spec
parent6f1ce7660e9888b195d2a09783f8261964a6549b (diff)
Merge branch 'winh-label-textcolor-default' into 'master'
Provide default for calculating label text color Closes #32728 See merge request !11681
Diffstat (limited to 'spec')
-rw-r--r--spec/models/label_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb
index 80ca19acdda..84867e3d96b 100644
--- a/spec/models/label_spec.rb
+++ b/spec/models/label_spec.rb
@@ -49,6 +49,23 @@ describe Label, models: true do
expect(label.color).to eq('#abcdef')
end
+
+ it 'uses default color if color is missing' do
+ label = described_class.new(color: nil)
+
+ expect(label.color).to be(Label::DEFAULT_COLOR)
+ end
+ end
+
+ describe '#text_color' do
+ it 'uses default color if color is missing' do
+ expect(LabelsHelper).to receive(:text_color_for_bg).with(Label::DEFAULT_COLOR).
+ and_return(spy)
+
+ label = described_class.new(color: nil)
+
+ label.text_color
+ end
end
describe '#title' do