<li>
<%= context_menu_link(
s.name,
- bulk_update_issues_path(
+ _bulk_update_issues_path(
+ @issue,
:ids => @issue_ids, :issue => {:status_id => s}, :back_url => @back
),
:method => :post,
<a href="#" class="submenu"><%= l(:field_tracker) %></a>
<ul>
<% @trackers.each do |t| -%>
- <li><%= context_menu_link t.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'tracker_id' => t}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link t.name, _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'tracker_id' => t}, :back_url => @back), :method => :patch,
:selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li>
<% end -%>
</ul>
<a href="#" class="submenu"><%= l(:field_priority) %></a>
<ul>
<% @priorities.each do |p| -%>
- <li><%= context_menu_link p.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'priority_id' => p}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link p.name, _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'priority_id' => p}, :back_url => @back), :method => :patch,
:selected => (@issue && p == @issue.priority), :disabled => (!@can[:edit] || @issues.any?(&:priority_derived?)) %></li>
<% end -%>
</ul>
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
<ul>
<% @versions.sort.each do |v| -%>
- <li><%= context_menu_link format_version_name(v), bulk_update_issues_path(:ids => @issue_ids, :issue => {'fixed_version_id' => v}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link format_version_name(v), _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'fixed_version_id' => v}, :back_url => @back), :method => :patch,
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:edit] %></li>
<% end -%>
- <li><%= context_menu_link l(:label_none), bulk_update_issues_path(:ids => @issue_ids, :issue => {'fixed_version_id' => 'none'}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link l(:label_none), _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'fixed_version_id' => 'none'}, :back_url => @back), :method => :patch,
:selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:edit] %></li>
</ul>
</li>
<a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
<ul>
<% if @assignables.include?(User.current) %>
- <li><%= context_menu_link "<< #{l(:label_me)} >>", bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => User.current}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link "<< #{l(:label_me)} >>", _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'assigned_to_id' => User.current}, :back_url => @back), :method => :patch,
:disabled => !@can[:edit] %></li>
<% end %>
<% @assignables.each do |u| -%>
- <li><%= context_menu_link u.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => u}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link u.name, _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'assigned_to_id' => u}, :back_url => @back), :method => :patch,
:selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:edit] %></li>
<% end -%>
- <li><%= context_menu_link l(:label_nobody), bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => 'none'}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link l(:label_nobody), _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'assigned_to_id' => 'none'}, :back_url => @back), :method => :patch,
:selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:edit] %></li>
</ul>
</li>
<a href="#" class="submenu"><%= l(:field_category) %></a>
<ul>
<% @project.issue_categories.each do |u| -%>
- <li><%= context_menu_link u.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'category_id' => u}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link u.name, _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'category_id' => u}, :back_url => @back), :method => :patch,
:selected => (@issue && u == @issue.category), :disabled => !@can[:edit] %></li>
<% end -%>
- <li><%= context_menu_link l(:label_none), bulk_update_issues_path(:ids => @issue_ids, :issue => {'category_id' => 'none'}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link l(:label_none), _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'category_id' => 'none'}, :back_url => @back), :method => :patch,
:selected => (@issue && @issue.category.nil?), :disabled => !@can[:edit] %></li>
</ul>
</li>
<a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
<ul>
<% (0..10).map{|x|x*10}.each do |p| -%>
- <li><%= context_menu_link "#{p}%", bulk_update_issues_path(:ids => @issue_ids, :issue => {'done_ratio' => p}, :back_url => @back), :method => :post,
+ <li><%= context_menu_link "#{p}%", _bulk_update_issues_path(@issue, :ids => @issue_ids, :issue => {'done_ratio' => p}, :back_url => @back), :method => :patch,
:selected => (@issue && p == @issue.done_ratio), :disabled => (!@can[:edit] || @issues.any?(&:done_ratio_derived?)) %></li>
<% end -%>
</ul>
:time_entries,
:custom_fields, :custom_fields_trackers, :custom_fields_projects
- def test_context_menu_one_issue
+ def test_context_menu_one_issue_should_link_to_issue_path
@request.session[:user_id] = 2
get(
:issues,
assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1', :text => 'Delete'
# Statuses
- assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bstatus_id%5D=5', :text => 'Closed'
- assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bpriority_id%5D=8', :text => 'Immediate'
+ assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bstatus_id%5D=5', :text => 'Closed'
+ assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bpriority_id%5D=8', :text => 'Immediate'
# No inactive priorities
assert_select 'a', :text => /Inactive Priority/, :count => 0
# Versions
- assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bfixed_version_id%5D=3', :text => '2.0'
- assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bfixed_version_id%5D=4', :text => 'eCookbook Subproject 1 - 2.0'
+ assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bfixed_version_id%5D=3', :text => '2.0'
+ assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bfixed_version_id%5D=4', :text => 'eCookbook Subproject 1 - 2.0'
# Assignees
- assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bassigned_to_id%5D=3', :text => 'Dave Lopper'
+ assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bassigned_to_id%5D=3', :text => 'Dave Lopper'
+ end
+
+ def test_context_menu_multiple_issues_should_link_to_bulk_update_issues_path
+ @request.session[:user_id] = 2
+ get :issues, :params => {
+ :ids => [1, 2]
+ }
+ assert_response :success
+
+ assert_select 'a.icon-edit[href=?]', '/issues/bulk_edit?ids%5B%5D=1&ids%5B%5D=2', :text => 'Edit'
+ assert_select 'a.icon-copy[href=?]', '/issues/bulk_edit?copy=1&ids%5B%5D=1&ids%5B%5D=2', :text => 'Copy'
+ assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1&ids%5B%5D=2', :text => 'Delete'
+
+ # Statuses
+ assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bstatus_id%5D=5', :text => 'Closed'
+ assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bpriority_id%5D=8', :text => 'Immediate'
+ # No inactive priorities
+ assert_select 'a', :text => /Inactive Priority/, :count => 0
+ # Versions
+ assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bfixed_version_id%5D=3', :text => '2.0'
+ assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bfixed_version_id%5D=4', :text => 'eCookbook Subproject 1 - 2.0'
+ # Assignees
+ assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bassigned_to_id%5D=3', :text => 'Dave Lopper'
end
def test_context_menu_one_issue_by_anonymous
get(
:issues,
:params => {
- :ids => [1]
+ :ids => [1, 2]
}
)
assert_response :success
- assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bassigned_to_id%5D=2', :text => / me /
+ assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bassigned_to_id%5D=2', :text => / me /
end
def test_context_menu_should_propose_shared_versions_for_issues_from_different_projects