summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-10-24 06:25:18 -0700
committerStan Hu <stanhu@gmail.com>2016-10-24 22:40:09 -0700
commitaf4d16d9b8eada31be308f87ab596e34e9907e73 (patch)
tree43b8edea2c628a5b951f817e27a8a9fbcc53aec0 /spec/finders
parent7c0ccbaac4aad5057f76d4f62b3a892aae64e190 (diff)
downloadgitlab-ce-af4d16d9b8eada31be308f87ab596e34e9907e73.tar.gz
Allow the use of params[:name] when filtering labels
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/labels_finder_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/finders/labels_finder_spec.rb b/spec/finders/labels_finder_spec.rb
index 114399ea3dc..eb8df8e2bb2 100644
--- a/spec/finders/labels_finder_spec.rb
+++ b/spec/finders/labels_finder_spec.rb
@@ -65,11 +65,23 @@ describe LabelsFinder do
expect(finder.execute).to eq [group_label_2]
end
+ it 'returns label with title alias' do
+ finder = described_class.new(user, name: 'Group Label 2')
+
+ expect(finder.execute).to eq [group_label_2]
+ end
+
it 'returns no labels if empty titles are supplied' do
finder = described_class.new(user, title: [])
expect(finder.execute).to be_empty
end
+
+ it 'returns no labels if empty names are supplied' do
+ finder = described_class.new(user, name: [])
+
+ expect(finder.execute).to be_empty
+ end
end
end
end