@assignables = @projects.map(&:assignable_users).reduce(:&)
@trackers = @projects.map(&:trackers).reduce(:&)
end
+ @versions = @projects.map {|p| p.shared_versions.open}.reduce(:&)
@priorities = IssuePriority.active.reverse
@back = back_url
</li>
<% end %>
- <% #TODO: allow editing versions when multiple projects %>
- <% if @safe_attributes.include?('fixed_version_id') && @project && @project.shared_versions.open.any? -%>
+ <% if @safe_attributes.include?('fixed_version_id') && @versions.any? -%>
<li class="folder">
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
<ul>
- <% @project.shared_versions.open.sort.each do |v| -%>
+ <% @versions.sort.each do |v| -%>
<li><%= context_menu_link format_version_name(v), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'fixed_version_id' => v}, :back_url => @back}, :method => :post,
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
<% end -%>
:class => '' }
end
+ def test_context_menu_should_propose_shared_versions_for_issues_from_different_projects
+ @request.session[:user_id] = 2
+ version = Version.create!(:name => 'Shared', :sharing => 'system', :project_id => 1)
+
+ get :issues, :ids => [1, 4]
+ assert_response :success
+ assert_template 'context_menu'
+
+ assert_include version, assigns(:versions)
+ assert_tag :tag => 'a', :content => 'eCookbook - Shared'
+ end
+
def test_context_menu_issue_visibility
get :issues, :ids => [1, 4]
assert_response :success