]> source.dussan.org Git - redmine.git/commitdiff
cleanup: rubocop: fix Layout/IndentFirstHashElement in test/functional/files_controll...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Nov 2019 14:26:26 +0000 (14:26 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Nov 2019 14:26:26 +0000 (14:26 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19195 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/files_controller_test.rb

index 59ea2930a2f5fc66fb88a422292c317e4434e32c..68f32b7cde31fa69ddbe1bd8131a962bfc6fc329 100644 (file)
@@ -39,9 +39,12 @@ class FilesControllerTest < Redmine::ControllerTest
   end
 
   def test_index
-    get :index, :params => {
+    get(
+      :index,
+      :params => {
         :project_id => 1
       }
+    )
     assert_response :success
 
     # file attached to the project
@@ -53,22 +56,26 @@ class FilesControllerTest < Redmine::ControllerTest
 
   def test_new
     @request.session[:user_id] = 2
-    get :new, :params => {
+    get(
+      :new,
+      :params => {
         :project_id => 1
       }
+    )
     assert_response :success
-
     assert_select 'select[name=?]', 'version_id'
   end
 
   def test_new_without_versions
     Version.delete_all
     @request.session[:user_id] = 2
-    get :new, :params => {
+    get(
+      :new,
+      :params => {
         :project_id => 1
       }
+    )
     assert_response :success
-
     assert_select 'select[name=?]', 'version_id', 0
   end
 
@@ -76,17 +83,20 @@ class FilesControllerTest < Redmine::ControllerTest
     set_tmp_attachments_directory
     @request.session[:user_id] = 2
     ActionMailer::Base.deliveries.clear
-
     with_settings :notified_events => %w(file_added) do
       assert_difference 'Attachment.count' do
-        post :create, :params => {
+        post(
+          :create,
+          :params => {
             :project_id => 1,
             :version_id => '',
             :attachments => {
               '1' => {
-              'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+                'file' => uploaded_test_file('testfile.txt', 'text/plain')
+              }
             }
           }
+        )
         assert_response :redirect
       end
     end
@@ -104,16 +114,19 @@ class FilesControllerTest < Redmine::ControllerTest
   def test_create_version_file
     set_tmp_attachments_directory
     @request.session[:user_id] = 2
-
     assert_difference 'Attachment.count' do
-      post :create, :params => {
+      post(
+        :create,
+        :params => {
           :project_id => 1,
           :version_id => '2',
           :attachments => {
             '1' => {
-            'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+              'file' => uploaded_test_file('testfile.txt', 'text/plain')
+            }
           }
         }
+      )
       assert_response :redirect
     end
     assert_redirected_to '/projects/ecookbook/files'
@@ -125,12 +138,14 @@ class FilesControllerTest < Redmine::ControllerTest
   def test_create_without_file
     set_tmp_attachments_directory
     @request.session[:user_id] = 2
-
     assert_no_difference 'Attachment.count' do
-      post :create, :params => {
+      post(
+        :create,
+        :params => {
           :project_id => 1,
           :version_id => ''
         }
+      )
       assert_response :success
     end
     assert_select 'div.error', 'File is invalid'