summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-15 14:05:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-15 14:05:29 +0000
commit5c43b4860e752965329e38a11a7e3f4b266b2d5b (patch)
tree862951a5cc6b89811e8b269de92c741e90a617cd
parente920e951e752f8859f5bc1028a4b338876a014f4 (diff)
downloadredmine-5c43b4860e752965329e38a11a7e3f4b266b2d5b.tar.gz
redmine-5c43b4860e752965329e38a11a7e3f4b266b2d5b.zip
Restored project name as version prefix when different (#19348).
git-svn-id: http://svn.redmine.org/redmine/trunk@14108 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--test/functional/issues_controller_test.rb2
-rw-r--r--test/unit/helpers/projects_helper_test.rb21
3 files changed, 8 insertions, 17 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c58873c20..7fdb49c07 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -240,7 +240,7 @@ module ApplicationHelper
end
def format_version_name(version)
- if !version.shared? || version.project == @project
+ if version.project == @project
h(version)
else
h("#{version.project} - #{version}")
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 3d048edbc..70e74baa5 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -849,7 +849,7 @@ class IssuesControllerTest < ActionController::TestCase
def test_index_with_fixed_version_column
get :index, :set_filter => 1, :c => %w(fixed_version)
assert_select 'table.issues td.fixed_version' do
- assert_select 'a[href=?]', '/versions/2', :text => '1.0'
+ assert_select 'a[href=?]', '/versions/2', :text => 'eCookbook - 1.0'
end
end
diff --git a/test/unit/helpers/projects_helper_test.rb b/test/unit/helpers/projects_helper_test.rb
index 713384527..5b7780510 100644
--- a/test/unit/helpers/projects_helper_test.rb
+++ b/test/unit/helpers/projects_helper_test.rb
@@ -47,18 +47,18 @@ class ProjectsHelperTest < ActionView::TestCase
def test_link_to_version
User.current = User.find(1)
- assert_equal '<a title="07/01/2006" href="/versions/5">Alpha</a>', link_to_version(Version.find(5))
+ assert_equal '<a title="07/01/2006" href="/versions/5">OnlineStore - Alpha</a>', link_to_version(Version.find(5))
end
def test_link_to_version_without_effective_date
User.current = User.find(1)
version = Version.find(5)
version.effective_date = nil
- assert_equal '<a href="/versions/5">Alpha</a>', link_to_version(version)
+ assert_equal '<a href="/versions/5">OnlineStore - Alpha</a>', link_to_version(version)
end
def test_link_to_private_version
- assert_equal 'Alpha', link_to_version(Version.find(5))
+ assert_equal 'OnlineStore - Alpha', link_to_version(Version.find(5))
end
def test_link_to_version_invalid_version
@@ -71,20 +71,11 @@ class ProjectsHelperTest < ActionView::TestCase
end
def test_format_version_name
- assert_equal "0.1", format_version_name(Version.find(1))
- end
-
- def test_format_version_name_for_shared_version_within_project_should_not_display_project_name
- @project = Project.find(1)
- version = Version.find(1)
- version.sharing = 'system'
- assert_equal "0.1", format_version_name(version)
+ assert_equal "eCookbook - 0.1", format_version_name(Version.find(1))
end
- def test_format_version_name_for_shared_version_should_display_project_name
- version = Version.find(1)
- version.sharing = 'system'
- assert_equal "eCookbook - 0.1", format_version_name(version)
+ def test_format_version_name_for_system_version
+ assert_equal "OnlineStore - Systemwide visible version", format_version_name(Version.find(7))
end
def test_version_options_for_select_with_no_versions