Project

General

Profile

Defect #32860 » new_test_and_fix.patch

Alexander Meindl, 2020-01-25 09:36

View differences:

test/helpers/version_helper_test.rb
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')
......
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
......
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)
(2-2/4)