]> source.dussan.org Git - redmine.git/commitdiff
use with_settings at IssuesControllerTest#test_index_with_project_and_subprojects
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 26 Oct 2020 13:36:20 +0000 (13:36 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 26 Oct 2020 13:36:20 +0000 (13:36 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20204 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/issues_controller_test.rb

index 66d71a5cdcccfc6e93e2fa6419cf1676501a2d3e..c46cded594f403bea63a09c14f62961123ef4b70 100644 (file)
@@ -109,13 +109,14 @@ class IssuesControllerTest < Redmine::ControllerTest
   end
 
   def test_index_with_project_and_subprojects
-    Setting.display_subprojects_issues = 1
-    get(:index, :params => {:project_id => 1})
-    assert_response :success
+    with_settings :display_subprojects_issues => '1' do
+      get(:index, :params => {:project_id => 1})
+      assert_response :success
 
-    assert_select 'a[href="/issues/1"]', :text => /Cannot print recipes/
-    assert_select 'a[href="/issues/5"]', :text => /Subproject issue/
-    assert_select 'a[href="/issues/6"]', 0
+      assert_select 'a[href="/issues/1"]', :text => /Cannot print recipes/
+      assert_select 'a[href="/issues/5"]', :text => /Subproject issue/
+      assert_select 'a[href="/issues/6"]', 0
+    end
   end
 
   def test_index_with_project_and_subprojects_should_show_private_subprojects_with_permission