summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-26 09:36:43 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-26 09:36:43 -0800
commit386178aedf917870af2517af8dda088d76b7041c (patch)
treebc4903f14cae1cd87e8c57fe68fe2e6225d8d5d6 /spec
parent01660f0d6d2fdf318e4695627ac6babd30e63467 (diff)
parentfaae454424e86a8794ec827ab0571457e346aa6b (diff)
downloadgitlab-ce-386178aedf917870af2517af8dda088d76b7041c.tar.gz
Merge branch 'master' of github.com:gitlabhq/gitlabhq
Diffstat (limited to 'spec')
-rw-r--r--spec/services/issues/bulk_update_service_spec.rb (renamed from spec/services/issues/bulk_update_context_spec.rb)19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/services/issues/bulk_update_context_spec.rb b/spec/services/issues/bulk_update_service_spec.rb
index eb867f78c5c..504213e667f 100644
--- a/spec/services/issues/bulk_update_context_spec.rb
+++ b/spec/services/issues/bulk_update_service_spec.rb
@@ -84,6 +84,25 @@ describe Issues::BulkUpdateService do
expect(@project.issues.first.assignee).to eq(@new_assignee)
}
+ it 'allows mass-unassigning' do
+ @project.issues.first.update_attribute(:assignee, @new_assignee)
+ expect(@project.issues.first.assignee).not_to be_nil
+
+ @params[:update][:assignee_id] = -1
+
+ Issues::BulkUpdateService.new(@project, @user, @params).execute
+ expect(@project.issues.first.assignee).to be_nil
+ end
+
+ it 'does not unassign when assignee_id is not present' do
+ @project.issues.first.update_attribute(:assignee, @new_assignee)
+ expect(@project.issues.first.assignee).not_to be_nil
+
+ @params[:update][:assignee_id] = ''
+
+ Issues::BulkUpdateService.new(@project, @user, @params).execute
+ expect(@project.issues.first.assignee).not_to be_nil
+ end
end
describe :update_milestone do