From 7448e0dbc41a53f643ac3c8ebd486d9aa02f593b Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang
<%= select_tag('issue[category_id]', content_tag('option', l(:label_no_change_option), :value => '') + content_tag('option', l(:label_none), :value => 'none') + - options_from_collection_for_select(@project.issue_categories, :id, :name)) %> + options_from_collection_for_select(@categories, :id, :name)) %>
-<% end %> -<% #TODO: allow editing versions when multiple projects %> -<% if @project %><%= select_tag('issue[fixed_version_id]', content_tag('option', l(:label_no_change_option), :value => '') + content_tag('option', l(:label_none), :value => 'none') + - version_options_for_select(@project.shared_versions.open.sort)) %> + version_options_for_select(@versions.sort)) %>
-<% end %> <% @custom_fields.each do |custom_field| %><%= custom_field_tag_for_bulk_edit('issue', custom_field, @projects) %>
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index f85d157ce..04df391a1 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2672,6 +2672,28 @@ class IssuesControllerTest < ActionController::TestCase :children => {:count => 3} # 2 statuses + "no change" option end + def test_bulk_edit_should_propose_target_project_open_shared_versions + @request.session[:user_id] = 2 + post :bulk_edit, :ids => [1, 2, 6], :issue => {:project_id => 1} + assert_response :success + assert_template 'bulk_edit' + assert_equal Project.find(1).shared_versions.open.all.sort, assigns(:versions).sort + assert_tag 'select', + :attributes => {:name => 'issue[fixed_version_id]'}, + :descendant => {:tag => 'option', :content => '2.0'} + end + + def test_bulk_edit_should_propose_target_project_categories + @request.session[:user_id] = 2 + post :bulk_edit, :ids => [1, 2, 6], :issue => {:project_id => 1} + assert_response :success + assert_template 'bulk_edit' + assert_equal Project.find(1).issue_categories.sort, assigns(:categories).sort + assert_tag 'select', + :attributes => {:name => 'issue[category_id]'}, + :descendant => {:tag => 'option', :content => 'Recipes'} + end + def test_bulk_update @request.session[:user_id] = 2 # update issues priority