]> source.dussan.org Git - redmine.git/commitdiff
use with_settings at IssuesControllerTest#test_index_with_project
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 24 Oct 2020 14:40:41 +0000 (14:40 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 24 Oct 2020 14:40:41 +0000 (14:40 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20188 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/issues_controller_test.rb

index 27bf2f3f1907bd501d501ef9d3c029ee6d678c34..66d71a5cdcccfc6e93e2fa6419cf1676501a2d3e 100644 (file)
@@ -89,23 +89,23 @@ class IssuesControllerTest < Redmine::ControllerTest
   end
 
   def test_index_with_project
-    Setting.display_subprojects_issues = 0
-    get(:index, :params => {:project_id => 1})
-    assert_response :success
+    with_settings :display_subprojects_issues => '0' do
+      get(:index, :params => {:project_id => 1})
+      assert_response :success
 
-    # query form
-    assert_select 'form#query_form' do
-      assert_select 'div#query_form_with_buttons.hide-when-print' do
-        assert_select 'div#query_form_content' do
-          assert_select 'fieldset#filters.collapsible'
-          assert_select 'fieldset#options'
+      # query form
+      assert_select 'form#query_form' do
+        assert_select 'div#query_form_with_buttons.hide-when-print' do
+          assert_select 'div#query_form_content' do
+            assert_select 'fieldset#filters.collapsible'
+            assert_select 'fieldset#options'
+          end
+          assert_select 'p.buttons'
         end
-        assert_select 'p.buttons'
       end
+      assert_select 'a[href="/issues/1"]', :text => /Cannot print recipes/
+      assert_select 'a[href="/issues/5"]', 0
     end
-
-    assert_select 'a[href="/issues/1"]', :text => /Cannot print recipes/
-    assert_select 'a[href="/issues/5"]', 0
   end
 
   def test_index_with_project_and_subprojects