@@ -339,11 +339,11 class ProjectsController < ApplicationController | |||
|
339 | 339 | # Bulk edit issues |
|
340 | 340 | def bulk_edit_issues |
|
341 | 341 | if request.post? |
|
342 | status = IssueStatus.find_by_id(params[:status_id]) | |
|
343 | priority = Enumeration.find_by_id(params[:priority_id]) | |
|
344 | assigned_to = User.find_by_id(params[:assigned_to_id]) | |
|
345 | category = @project.issue_categories.find_by_id(params[:category_id]) | |
|
346 | fixed_version = @project.versions.find_by_id(params[:fixed_version_id]) | |
|
342 | status = params[:status_id].blank? ? nil : IssueStatus.find_by_id(params[:status_id]) | |
|
343 | priority = params[:priority_id].blank? ? nil : Enumeration.find_by_id(params[:priority_id]) | |
|
344 | assigned_to = params[:assigned_to_id].blank? ? nil : User.find_by_id(params[:assigned_to_id]) | |
|
345 | category = params[:category_id].blank? ? nil : @project.issue_categories.find_by_id(params[:category_id]) | |
|
346 | fixed_version = params[:fixed_version_id].blank? ? nil : @project.versions.find_by_id(params[:fixed_version_id]) | |
|
347 | 347 | issues = @project.issues.find_all_by_id(params[:issue_ids]) |
|
348 | 348 | unsaved_issue_ids = [] |
|
349 | 349 | issues.each do |issue| |
@@ -13,7 +13,7 | |||
|
13 | 13 | </p> |
|
14 | 14 | <p> |
|
15 | 15 | <label><%= l(:field_assigned_to) %>: |
|
16 | <%= select_tag('assigned_to_id', content_tag('option', l(:label_no_change_option)) + | |
|
16 | <%= select_tag('assigned_to_id', content_tag('option', l(:label_no_change_option), :value => '') + | |
|
17 | 17 | content_tag('option', l(:label_nobody), :value => 'none') + |
|
18 | 18 | options_from_collection_for_select(@project.assignable_users, :id, :name)) %></label> |
|
19 | 19 | <label><%= l(:field_fixed_version) %>: |
@@ -22,7 +22,7 require 'projects_controller' | |||
|
22 | 22 | class ProjectsController; def rescue_action(e) raise e end; end |
|
23 | 23 | |
|
24 | 24 | class ProjectsControllerTest < Test::Unit::TestCase |
|
25 | fixtures :projects, :users, :roles, :enabled_modules | |
|
25 | fixtures :projects, :users, :roles, :enabled_modules, :enumerations | |
|
26 | 26 | |
|
27 | 27 | def setup |
|
28 | 28 | @controller = ProjectsController.new |
@@ -87,11 +87,11 class ProjectsControllerTest < Test::Unit::TestCase | |||
|
87 | 87 | def test_bulk_edit_issues |
|
88 | 88 | @request.session[:user_id] = 2 |
|
89 | 89 | # update issues priority |
|
90 |
post :bulk_edit_issues, :id => 1, :issue_ids => [1, 2], :priority_id => 7, :notes => |
|
|
90 | post :bulk_edit_issues, :id => 1, :issue_ids => [1, 2], :priority_id => 7, :notes => 'Bulk editing', :assigned_to_id => '' | |
|
91 | 91 | assert_response 302 |
|
92 | 92 | # check that the issues were updated |
|
93 | 93 | assert_equal [7, 7], Issue.find_all_by_id([1, 2]).collect {|i| i.priority.id} |
|
94 |
assert_equal |
|
|
94 | assert_equal 'Bulk editing', Issue.find(1).journals.find(:first, :order => 'created_on DESC').notes | |
|
95 | 95 | end |
|
96 | 96 | |
|
97 | 97 | def test_list_news |
General Comments 0
You need to be logged in to leave comments.
Login now