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:
authorStan Hu <stanhu@gmail.com>2016-10-24 02:46:21 +0300
committerStan Hu <stanhu@gmail.com>2016-10-25 08:40:08 +0300
commitddafea060d4b607cd3f5c29e947cdbf6483dcd5d (patch)
tree18228dce12f544994f1c77d448a76a18fd8eb7d2 /spec/finders/labels_finder_spec.rb
parentadd3a2c4431f29ca84c956f5604769505f0f0904 (diff)
Fix bug where labels would be assigned to issues that were moved
If you attempt to move an issue from one project to another and leave labels blank, LabelsFinder would assign all labels in the new project to that issue. The issue is that :title is passed along to the Finder, but since it appears empty no filtering is done. As a result, all labels in the group are returned. This fix handles that case. Closes #23668
Diffstat (limited to 'spec/finders/labels_finder_spec.rb')
-rw-r--r--spec/finders/labels_finder_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/finders/labels_finder_spec.rb b/spec/finders/labels_finder_spec.rb
index 27acc464ea2..114399ea3dc 100644
--- a/spec/finders/labels_finder_spec.rb
+++ b/spec/finders/labels_finder_spec.rb
@@ -64,6 +64,12 @@ describe LabelsFinder do
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
end
end
end