diff --git a/test/helpers/version_helper_test.rb b/test/helpers/version_helper_test.rb index 697ed5746..4072f5e30 100644 --- a/test/helpers/version_helper_test.rb +++ b/test/helpers/version_helper_test.rb @@ -22,7 +22,7 @@ require File.expand_path('../../test_helper', __FILE__) class VersionsHelperTest < Redmine::HelperTest include Rails.application.routes.url_helpers - fixtures :projects, :versions + fixtures :projects, :versions, :enabled_modules def test_version_filtered_issues_path_sharing_none version = Version.new(:name => 'test', :sharing => 'none') @@ -39,7 +39,7 @@ class VersionsHelperTest < Redmine::HelperTest def test_version_filtered_issues_path_sharing_hierarchy version = Version.new(:name => 'test', :sharing => 'hierarchy') version.project = Project.find(5) - assert_match '/projects/ecookbook/issues?', version_filtered_issues_path(version) + assert_match '/projects/private-child/issues?', version_filtered_issues_path(version) end def test_version_filtered_issues_path_sharing_tree @@ -48,6 +48,14 @@ class VersionsHelperTest < Redmine::HelperTest assert_match '/projects/ecookbook/issues?', version_filtered_issues_path(version) end + def test_version_filtered_issues_path_sharing_tree_without_permission_to_root_project + EnabledModule.where("name = 'issue_tracking' AND project_id = 1").delete_all + version = Version.new(:name => 'test', :sharing => 'tree') + version.project = Project.find(5) + assert_no_match '/projects/ecookbook/issues?', version_filtered_issues_path(version) + assert_match '/issues?', version_filtered_issues_path(version) + end + def test_version_filtered_issues_path_sharing_system version = Version.new(:name => 'test', :sharing => 'system') version.project = Project.find(5)