module VersionsHelper
+ def version_anchor(version)
+ if @project == version.project
+ anchor version.name
+ else
+ anchor "#{version.project.try(:identifier)}-#{version.name}"
+ end
+ end
+
STATUS_BY_CRITERIAS = %w(tracker status priority author assigned_to category)
def render_issue_status_by(version, criteria)
<% else %>
<div id="roadmap">
<% @versions.each do |version| %>
- <h3 class="version"><%= link_to_version version, :name => anchor(version.name) %></h3>
+ <h3 class="version"><%= link_to_version version, :name => version_anchor(version) %></h3>
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
<h3><%= l(:label_version_plural) %></h3>
<% @versions.each do |version| %>
-<%= link_to format_version_name(version), "##{anchor(version.name)}" %><br />
+<%= link_to format_version_name(version), "##{version_anchor(version)}" %><br />
<% end %>
<% if @completed_versions.present? %>
<p>
assert assigns(:versions).include?(@subproject_version), "Subproject version not found"
end
+ def test_index_should_prepend_shared_versions
+ get :index, :project_id => 1
+ assert_response :success
+
+ assert_select '#sidebar' do
+ assert_select 'a[href=?]', '#2.0', :text => '2.0'
+ assert_select 'a[href=?]', '#subproject1-2.0', :text => 'eCookbook Subproject 1 - 2.0'
+ end
+ assert_select '#content' do
+ assert_select 'a[name=?]', '2.0', :text => '2.0'
+ assert_select 'a[name=?]', 'subproject1-2.0', :text => 'eCookbook Subproject 1 - 2.0'
+ end
+ end
+
def test_show
get :show, :id => 2
assert_response :success