mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 07:46:17 +01:00
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
This commit is contained in:
@@ -2261,25 +2261,26 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_show_should_not_disclose_relations_to_invisible_issues
|
def test_show_should_not_disclose_relations_to_invisible_issues
|
||||||
Setting.cross_project_issue_relations = '1'
|
with_settings :cross_project_issue_relations => '1' do
|
||||||
IssueRelation.
|
IssueRelation.
|
||||||
create!(
|
create!(
|
||||||
:issue_from => Issue.find(1),
|
:issue_from => Issue.find(1),
|
||||||
:issue_to => Issue.find(2),
|
:issue_to => Issue.find(2),
|
||||||
:relation_type => 'relates'
|
:relation_type => 'relates'
|
||||||
)
|
)
|
||||||
# Relation to a private project issue
|
# Relation to a private project issue
|
||||||
IssueRelation.
|
IssueRelation.
|
||||||
create!(
|
create!(
|
||||||
:issue_from => Issue.find(1),
|
:issue_from => Issue.find(1),
|
||||||
:issue_to => Issue.find(4),
|
:issue_to => Issue.find(4),
|
||||||
:relation_type => 'relates'
|
:relation_type => 'relates'
|
||||||
)
|
)
|
||||||
get(:show, :params => {:id => 1})
|
get(:show, :params => {:id => 1})
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select 'div#relations' do
|
assert_select 'div#relations' do
|
||||||
assert_select 'a', :text => /#2$/
|
assert_select 'a', :text => /#2$/
|
||||||
assert_select 'a', :text => /#4$/, :count => 0
|
assert_select 'a', :text => /#4$/, :count => 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user