##// END OF EJS Templates
Merges r14151 to r14153 (#19163)....
Jean-Philippe Lang -
r13821:97939f8829b4
parent child
Show More
@@ -229,7 +229,7 class IssuesController < ApplicationController
229 229 else
230 230 @available_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&)
231 231 end
232 @custom_fields = target_projects.map{|p|p.all_issue_custom_fields.visible}.reduce(:&)
232 @custom_fields = @issues.map{|i|i.editable_custom_fields}.reduce(:&)
233 233 @assignables = target_projects.map(&:assignable_users).reduce(:&)
234 234 @trackers = target_projects.map(&:trackers).reduce(:&)
235 235 @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
@@ -26,3 +26,6 custom_fields_trackers_008:
26 26 custom_fields_trackers_009:
27 27 custom_field_id: 8
28 28 tracker_id: 3
29 custom_fields_trackers_010:
30 custom_field_id: 9
31 tracker_id: 1
@@ -3389,7 +3389,7 class IssuesControllerTest < ActionController::TestCase
3389 3389
3390 3390 def test_get_bulk_edit
3391 3391 @request.session[:user_id] = 2
3392 get :bulk_edit, :ids => [1, 2]
3392 get :bulk_edit, :ids => [1, 3]
3393 3393 assert_response :success
3394 3394 assert_template 'bulk_edit'
3395 3395
@@ -3440,7 +3440,7 class IssuesControllerTest < ActionController::TestCase
3440 3440 end
3441 3441
3442 3442 def test_get_bulk_edit_with_user_custom_field
3443 field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true)
3443 field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :tracker_ids => [1,2,3])
3444 3444
3445 3445 @request.session[:user_id] = 2
3446 3446 get :bulk_edit, :ids => [1, 2]
@@ -3453,7 +3453,7 class IssuesControllerTest < ActionController::TestCase
3453 3453 end
3454 3454
3455 3455 def test_get_bulk_edit_with_version_custom_field
3456 field = IssueCustomField.create!(:name => 'Affected version', :field_format => 'version', :is_for_all => true)
3456 field = IssueCustomField.create!(:name => 'Affected version', :field_format => 'version', :is_for_all => true, :tracker_ids => [1,2,3])
3457 3457
3458 3458 @request.session[:user_id] = 2
3459 3459 get :bulk_edit, :ids => [1, 2]
@@ -3470,7 +3470,7 class IssuesControllerTest < ActionController::TestCase
3470 3470 field.update_attribute :multiple, true
3471 3471
3472 3472 @request.session[:user_id] = 2
3473 get :bulk_edit, :ids => [1, 2]
3473 get :bulk_edit, :ids => [1, 3]
3474 3474 assert_response :success
3475 3475 assert_template 'bulk_edit'
3476 3476
@@ -3536,6 +3536,17 class IssuesControllerTest < ActionController::TestCase
3536 3536 end
3537 3537 end
3538 3538
3539 def test_bulk_edit_should_only_propose_issues_trackers_custom_fields
3540 IssueCustomField.delete_all
3541 field = IssueCustomField.generate!(:tracker_ids => [1], :is_for_all => true)
3542 IssueCustomField.generate!(:tracker_ids => [2], :is_for_all => true)
3543 @request.session[:user_id] = 2
3544
3545 issue_ids = Issue.where(:project_id => 1, :tracker_id => 1).limit(2).ids
3546 get :bulk_edit, :ids => issue_ids
3547 assert_equal [field], assigns(:custom_fields)
3548 end
3549
3539 3550 def test_bulk_update
3540 3551 @request.session[:user_id] = 2
3541 3552 # update issues priority
General Comments 0
You need to be logged in to leave comments. Login now