diff options
author | winh <winnie@gitlab.com> | 2017-05-24 14:36:00 +0200 |
---|---|---|
committer | winh <winnie@gitlab.com> | 2017-05-25 19:08:37 +0200 |
commit | e63d27d83bdf9c07776c18ebc297d75728aa7e29 (patch) | |
tree | 1b6222c95c6e5735556599c48d62047097f5c029 | |
parent | b00c268b4c13db50e676581a3b8fe4ce2cce6de3 (diff) | |
download | gitlab-ce-e63d27d83bdf9c07776c18ebc297d75728aa7e29.tar.gz |
Add failing test for #32728
-rw-r--r-- | spec/models/label_spec.rb | 17 |
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 |