summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-05-31 11:14:15 +0100
committerAlfredo Sumaran <alfredo@gitlab.com>2016-06-03 17:14:23 -0500
commit165d799fb3ca36768497d964619ceeacf2deeae3 (patch)
tree1c83422f67507ca7bbaca4b3617f3fdabe3de746 /spec/services
parentd78fd6df0c21f56887d1ca76cb5a40c16d3552b0 (diff)
downloadgitlab-ce-165d799fb3ca36768497d964619ceeacf2deeae3.tar.gz
Allow bulk-updating to remove all labels
Instead of passing `remove_label_ids`, just pass an empty array for `label_ids` (and don't pass `add_label_ids` or `remove_label_ids`).
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/issues/bulk_update_service_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/issues/bulk_update_service_spec.rb b/spec/services/issues/bulk_update_service_spec.rb
index c777d475dd4..ad19fe0f151 100644
--- a/spec/services/issues/bulk_update_service_spec.rb
+++ b/spec/services/issues/bulk_update_service_spec.rb
@@ -148,6 +148,14 @@ describe Issues::BulkUpdateService, services: true do
it 'does not update issues not passed in' do
expect(issue_bug_and_regression.label_ids).to contain_exactly(bug.id, regression.id)
end
+
+ context 'when those label IDs are empty' do
+ let(:labels) { [] }
+
+ it 'updates the issues passed to have no labels' do
+ expect(issues.map(&:reload).map(&:label_ids)).to all(be_empty)
+ end
+ end
end
context 'when add_label_ids are passed' do