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:
authorRobert Speicher <rspeicher@gmail.com>2015-02-25 12:29:33 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-02-26 07:57:23 +0300
commite53dd7526f69545ca86fc6935ad8077592628772 (patch)
tree813c67fb5db615e733e222a2bbaefc6885ed5466 /spec/services/issues
parent8490a8ab2a70828e4bb5587c7cc07c750483ef2e (diff)
Allow mass-unassigning of issues
Fixes #867 [ci skip]
Diffstat (limited to 'spec/services/issues')
-rw-r--r--spec/services/issues/bulk_update_service_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/services/issues/bulk_update_service_spec.rb b/spec/services/issues/bulk_update_service_spec.rb
index eb867f78c5c..504213e667f 100644
--- a/spec/services/issues/bulk_update_service_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