summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-26 09:04:23 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-26 09:04:23 -0800
commitfaae454424e86a8794ec827ab0571457e346aa6b (patch)
tree9799d5d705b646652b74eabb286d2e35fb27798e
parent7fef8456e8bc92adb0de3f2bc7192e3bedfce47d (diff)
parente53dd7526f69545ca86fc6935ad8077592628772 (diff)
downloadgitlab-ce-faae454424e86a8794ec827ab0571457e346aa6b.tar.gz
Merge pull request #8869 from tsigo/rs-issue-867
Allow mass-unassigning of issues
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/javascripts/project_users_select.js.coffee2
-rw-r--r--spec/services/issues/bulk_update_service_spec.rb (renamed from spec/services/issues/bulk_update_context_spec.rb)19
3 files changed, 21 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d5b05125110..3f9af5b9f9f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,7 @@ v 7.9.0 (unreleased)
- Fix ordering of imported but unchanged projects (Marco Wessel)
- Mobile UI improvements: make aside content expandable
- Generalize image upload in drag and drop in markdown to all files (Hannes Rosenögger)
+ - Fix mass-unassignment of issues (Robert Speicher)
v 7.8.1
- Fix run of custom post receive hooks
diff --git a/app/assets/javascripts/project_users_select.js.coffee b/app/assets/javascripts/project_users_select.js.coffee
index 7fb33926096..885f0d58a6a 100644
--- a/app/assets/javascripts/project_users_select.js.coffee
+++ b/app/assets/javascripts/project_users_select.js.coffee
@@ -15,7 +15,7 @@ class @ProjectUsersSelect
name: 'Unassigned',
avatar: null,
username: 'none',
- id: ''
+ id: -1
}
data.results.unshift(nullUser)
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