diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-26 09:36:43 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-26 09:36:43 -0800 |
commit | 386178aedf917870af2517af8dda088d76b7041c (patch) | |
tree | bc4903f14cae1cd87e8c57fe68fe2e6225d8d5d6 /spec | |
parent | 01660f0d6d2fdf318e4695627ac6babd30e63467 (diff) | |
parent | faae454424e86a8794ec827ab0571457e346aa6b (diff) | |
download | gitlab-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 |