diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-10-22 14:18:44 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-10-22 14:18:44 +0000 |
commit | 5280861cf309652d0ebf64658ef9cf2563ef8745 (patch) | |
tree | 2cbf0817aac6c11de1fa1693a6e12a2c2278e7f8 /test | |
parent | 0470d27d0d3bcbeb1cbbf39db1f8afb06f686fd2 (diff) | |
download | redmine-5280861cf309652d0ebf64658ef9cf2563ef8745.tar.gz redmine-5280861cf309652d0ebf64658ef9cf2563ef8745.zip |
use with_settings at IssuesControllerTest#test_show_should_not_disclose_relations_to_invisible_issues
git-svn-id: http://svn.redmine.org/redmine/trunk@20167 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/issues_controller_test.rb | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index edf973e6a..27bf2f3f1 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2261,25 +2261,26 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_show_should_not_disclose_relations_to_invisible_issues - Setting.cross_project_issue_relations = '1' - IssueRelation. - create!( - :issue_from => Issue.find(1), - :issue_to => Issue.find(2), - :relation_type => 'relates' - ) - # Relation to a private project issue - IssueRelation. - create!( - :issue_from => Issue.find(1), - :issue_to => Issue.find(4), - :relation_type => 'relates' - ) - get(:show, :params => {:id => 1}) - assert_response :success - assert_select 'div#relations' do - assert_select 'a', :text => /#2$/ - assert_select 'a', :text => /#4$/, :count => 0 + with_settings :cross_project_issue_relations => '1' do + IssueRelation. + create!( + :issue_from => Issue.find(1), + :issue_to => Issue.find(2), + :relation_type => 'relates' + ) + # Relation to a private project issue + IssueRelation. + create!( + :issue_from => Issue.find(1), + :issue_to => Issue.find(4), + :relation_type => 'relates' + ) + get(:show, :params => {:id => 1}) + assert_response :success + assert_select 'div#relations' do + assert_select 'a', :text => /#2$/ + assert_select 'a', :text => /#4$/, :count => 0 + end end end |