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:
authorJan Provaznik <jprovaznik@gitlab.com>2019-04-04 16:34:55 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2019-04-04 20:34:14 +0300
commitf88607923afd5a2adfb7a28df297528cbb27885b (patch)
tree3415bd1d40ae6bd92c37ac434473c2066dea5f2e /spec/helpers/labels_helper_spec.rb
parentfec2e27f1dcbb806247d6f78ebae628622c02d52 (diff)
Fix scoped_labels feature check
Check this feature per project/group instead of globally. Also do not show tooltip if it's disabled.
Diffstat (limited to 'spec/helpers/labels_helper_spec.rb')
-rw-r--r--spec/helpers/labels_helper_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb
index 012678db9c2..a049b5a6133 100644
--- a/spec/helpers/labels_helper_spec.rb
+++ b/spec/helpers/labels_helper_spec.rb
@@ -249,4 +249,24 @@ describe LabelsHelper do
.to match_array([label2, label4, label1, label3])
end
end
+
+ describe 'label_from_hash' do
+ it 'builds a group label with whitelisted attributes' do
+ label = label_from_hash({ title: 'foo', color: 'bar', id: 1, group_id: 1 })
+
+ expect(label).to be_a(GroupLabel)
+ expect(label.id).to be_nil
+ expect(label.title).to eq('foo')
+ expect(label.color).to eq('bar')
+ end
+
+ it 'builds a project label with whitelisted attributes' do
+ label = label_from_hash({ title: 'foo', color: 'bar', id: 1, project_id: 1 })
+
+ expect(label).to be_a(ProjectLabel)
+ expect(label.id).to be_nil
+ expect(label.title).to eq('foo')
+ expect(label.color).to eq('bar')
+ end
+ end
end