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
22 22
class VersionsHelperTest < Redmine::HelperTest
23 23
  include Rails.application.routes.url_helpers
24 24

  
25
  fixtures :projects, :versions
25
  fixtures :projects, :versions, :enabled_modules
26 26

  
27 27
  def test_version_filtered_issues_path_sharing_none
28 28
    version = Version.new(:name => 'test', :sharing => 'none')
......
39 39
  def test_version_filtered_issues_path_sharing_hierarchy
40 40
    version = Version.new(:name => 'test', :sharing => 'hierarchy')
41 41
    version.project = Project.find(5)
42
    assert_match '/projects/ecookbook/issues?', version_filtered_issues_path(version)
42
    assert_match '/projects/private-child/issues?', version_filtered_issues_path(version)
43 43
  end
44 44

  
45 45
  def test_version_filtered_issues_path_sharing_tree
......
48 48
    assert_match '/projects/ecookbook/issues?', version_filtered_issues_path(version)
49 49
  end
50 50

  
51
  def test_version_filtered_issues_path_sharing_tree_without_permission_to_root_project
52
    EnabledModule.where("name = 'issue_tracking' AND project_id = 1").delete_all
53
    version = Version.new(:name => 'test', :sharing => 'tree')
54
    version.project = Project.find(5)
55
    assert_no_match '/projects/ecookbook/issues?', version_filtered_issues_path(version)
56
    assert_match '/issues?', version_filtered_issues_path(version)
57
  end
58

  
51 59
  def test_version_filtered_issues_path_sharing_system
52 60
    version = Version.new(:name => 'test', :sharing => 'system')
53 61
    version.project = Project.find(5)
(2-2/4)