From 527cd5734a981fe28afabfac65b9b2392ab8717f Mon Sep 17 00:00:00 2001
From: Eric Davis
Date: Sun, 31 Oct 2010 23:56:20 +0000
Subject: [PATCH] Merged r4291 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4329 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
app/controllers/issue_moves_controller.rb | 2 +-
app/views/issue_moves/new.rhtml | 5 +++++
test/functional/issue_moves_controller_test.rb | 13 +++++++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/app/controllers/issue_moves_controller.rb b/app/controllers/issue_moves_controller.rb
index 6ac46a1ee..804ecb7bb 100644
--- a/app/controllers/issue_moves_controller.rb
+++ b/app/controllers/issue_moves_controller.rb
@@ -54,7 +54,7 @@ class IssueMovesController < ApplicationController
def extract_changed_attributes_for_move(params)
changed_attributes = {}
- [:assigned_to_id, :status_id, :start_date, :due_date].each do |valid_attribute|
+ [:assigned_to_id, :status_id, :start_date, :due_date, :priority_id].each do |valid_attribute|
unless params[valid_attribute].blank?
changed_attributes[valid_attribute] = (params[valid_attribute] == 'none' ? nil : params[valid_attribute])
end
diff --git a/app/views/issue_moves/new.rhtml b/app/views/issue_moves/new.rhtml
index 2dc971df2..946ddab95 100644
--- a/app/views/issue_moves/new.rhtml
+++ b/app/views/issue_moves/new.rhtml
@@ -33,6 +33,11 @@
<%= select_tag('status_id', "" + options_from_collection_for_select(@available_statuses, :id, :name)) %>
+
+
+ <%= select_tag('priority_id', "" + options_from_collection_for_select(IssuePriority.all, :id, :name)) %>
+
+
<%= text_field_tag 'start_date', '', :size => 10 %><%= calendar_for('start_date') %>
diff --git a/test/functional/issue_moves_controller_test.rb b/test/functional/issue_moves_controller_test.rb
index 7c4005767..62593ac37 100644
--- a/test/functional/issue_moves_controller_test.rb
+++ b/test/functional/issue_moves_controller_test.rb
@@ -40,6 +40,19 @@ class IssueMovesControllerTest < ActionController::TestCase
assert_equal 2, Issue.find(2).tracker_id
end
+ context "#create via bulk move" do
+ should "allow changing the issue priority" do
+ @request.session[:user_id] = 2
+ post :create, :ids => [1, 2], :priority_id => 6
+
+ assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+ assert_equal 6, Issue.find(1).priority_id
+ assert_equal 6, Issue.find(2).priority_id
+
+ end
+
+ end
+
def test_bulk_copy_to_another_project
@request.session[:user_id] = 2
assert_difference 'Issue.count', 2 do
--
2.39.5