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:
authorwinh <winnie@gitlab.com>2017-05-24 15:36:00 +0300
committerwinh <winnie@gitlab.com>2017-05-25 20:08:37 +0300
commite63d27d83bdf9c07776c18ebc297d75728aa7e29 (patch)
tree1b6222c95c6e5735556599c48d62047097f5c029 /spec/models
parentb00c268b4c13db50e676581a3b8fe4ce2cce6de3 (diff)
Add failing test for #32728
Diffstat (limited to 'spec/models')
-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