]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Layout/IndentHeredoc in test/integration/api_test/files_te...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 14 Oct 2019 11:13:38 +0000 (11:13 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 14 Oct 2019 11:13:38 +0000 (11:13 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18650 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
test/integration/api_test/files_test.rb

index 48be0377074bb5b4c43797103c9556c38ec2df2e..b389604f375f60f26930f7596e136df0b5ca2894 100644 (file)
@@ -270,7 +270,6 @@ Layout/IndentFirstHashElement:
 Layout/IndentHeredoc:
   Exclude:
     - 'test/helpers/application_helper_test.rb'
-    - 'test/integration/api_test/files_test.rb'
     - 'test/integration/lib/redmine/hook_test.rb'
     - 'test/unit/lib/redmine/syntax_highlighting/rouge_test.rb'
     - 'test/unit/lib/redmine/unified_diff_test.rb'
index f57461ef2cf862edbf12337d8de576a4cf0a88cd..26054109497d115cebd828a7349a31e9750b8c02 100644 (file)
@@ -41,11 +41,11 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
       :params => 'File content',
       :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
     token = Attachment.last.token
-    payload = <<-JSON
-{ "file": {
-    "token": "#{token}"
-  }
-}
+    payload = <<~JSON
+      { "file": {
+        "token": "#{token}"
+        }
+      }
     JSON
     post '/projects/1/files.json',
       :params => payload,
@@ -61,10 +61,10 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
       :params => 'File content',
       :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
     token = Attachment.last.token
-    payload = <<-XML
-<file>
-  <token>#{token}</token>
-</file>
+    payload = <<~XML
+      <file>
+        <token>#{token}</token>
+      </file>
     XML
     post '/projects/1/files.xml',
       :params => payload,
@@ -75,11 +75,11 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
   end
 
   test "POST /projects/:project_id/files.json should refuse requests without the :token parameter" do
-    payload = <<-JSON
-{ "file": {
-    "filename": "project_file.zip",
-  }
-}
+    payload = <<~JSON
+      { "file": {
+          "filename": "project_file.zip",
+        }
+      }
     JSON
     post '/projects/1/files.json',
       :params => payload,
@@ -93,14 +93,14 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
       :params => 'File content',
       :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
     token = Attachment.last.token
-    payload = <<-JSON
-{ "file": {
-    "filename": "New filename",
-    "description": "New description",
-    "content_type": "application/txt",
-    "token": "#{token}"
-  }
-}
+    payload = <<~JSON
+      { "file": {
+          "filename": "New filename",
+          "description": "New description",
+          "content_type": "application/txt",
+          "token": "#{token}"
+        }
+      }
     JSON
     post '/projects/1/files.json',
       :params => payload,
@@ -117,14 +117,14 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
       :params => 'File content',
       :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
     token = Attachment.last.token
-    payload = <<-JSON
-{ "file": {
-    "version_id": 3,
-    "filename": "New filename",
-    "description": "New description",
-    "token": "#{token}"
-  }
-}
+    payload = <<~JSON
+      { "file": {
+          "version_id": 3,
+          "filename": "New filename",
+          "description": "New description",
+          "token": "#{token}"
+        }
+      }
     JSON
     post '/projects/1/files.json',
       :params => payload,