Skip to content

Commit 5280861

Browse files
committed
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
1 parent 0470d27 commit 5280861

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

test/functional/issues_controller_test.rb

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,25 +2261,26 @@ def test_show_should_format_related_issues_dates
22612261
end
22622262

22632263
def test_show_should_not_disclose_relations_to_invisible_issues
2264-
Setting.cross_project_issue_relations = '1'
2265-
IssueRelation.
2266-
create!(
2267-
:issue_from => Issue.find(1),
2268-
:issue_to => Issue.find(2),
2269-
:relation_type => 'relates'
2270-
)
2271-
# Relation to a private project issue
2272-
IssueRelation.
2273-
create!(
2274-
:issue_from => Issue.find(1),
2275-
:issue_to => Issue.find(4),
2276-
:relation_type => 'relates'
2277-
)
2278-
get(:show, :params => {:id => 1})
2279-
assert_response :success
2280-
assert_select 'div#relations' do
2281-
assert_select 'a', :text => /#2$/
2282-
assert_select 'a', :text => /#4$/, :count => 0
2264+
with_settings :cross_project_issue_relations => '1' do
2265+
IssueRelation.
2266+
create!(
2267+
:issue_from => Issue.find(1),
2268+
:issue_to => Issue.find(2),
2269+
:relation_type => 'relates'
2270+
)
2271+
# Relation to a private project issue
2272+
IssueRelation.
2273+
create!(
2274+
:issue_from => Issue.find(1),
2275+
:issue_to => Issue.find(4),
2276+
:relation_type => 'relates'
2277+
)
2278+
get(:show, :params => {:id => 1})
2279+
assert_response :success
2280+
assert_select 'div#relations' do
2281+
assert_select 'a', :text => /#2$/
2282+
assert_select 'a', :text => /#4$/, :count => 0
2283+
end
22832284
end
22842285
end
22852286

0 commit comments

Comments
 (0)