code cleanup: rubocop: fix Layout/IndentHeredoc in test/integration/api_test/files_test.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18650 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2019-10-14 11:13:38 +00:00
parent b9d215c656
commit 762d015e15
2 changed files with 30 additions and 31 deletions

View File

@@ -270,7 +270,6 @@ Layout/IndentFirstHashElement:
Layout/IndentHeredoc: Layout/IndentHeredoc:
Exclude: Exclude:
- 'test/helpers/application_helper_test.rb' - 'test/helpers/application_helper_test.rb'
- 'test/integration/api_test/files_test.rb'
- 'test/integration/lib/redmine/hook_test.rb' - 'test/integration/lib/redmine/hook_test.rb'
- 'test/unit/lib/redmine/syntax_highlighting/rouge_test.rb' - 'test/unit/lib/redmine/syntax_highlighting/rouge_test.rb'
- 'test/unit/lib/redmine/unified_diff_test.rb' - 'test/unit/lib/redmine/unified_diff_test.rb'

View File

@@ -41,11 +41,11 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
:params => 'File content', :params => 'File content',
:headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith')) :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
token = Attachment.last.token token = Attachment.last.token
payload = <<-JSON payload = <<~JSON
{ "file": { { "file": {
"token": "#{token}" "token": "#{token}"
} }
} }
JSON JSON
post '/projects/1/files.json', post '/projects/1/files.json',
:params => payload, :params => payload,
@@ -61,10 +61,10 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
:params => 'File content', :params => 'File content',
:headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith')) :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
token = Attachment.last.token token = Attachment.last.token
payload = <<-XML payload = <<~XML
<file> <file>
<token>#{token}</token> <token>#{token}</token>
</file> </file>
XML XML
post '/projects/1/files.xml', post '/projects/1/files.xml',
:params => payload, :params => payload,
@@ -75,11 +75,11 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
end end
test "POST /projects/:project_id/files.json should refuse requests without the :token parameter" do test "POST /projects/:project_id/files.json should refuse requests without the :token parameter" do
payload = <<-JSON payload = <<~JSON
{ "file": { { "file": {
"filename": "project_file.zip", "filename": "project_file.zip",
} }
} }
JSON JSON
post '/projects/1/files.json', post '/projects/1/files.json',
:params => payload, :params => payload,
@@ -93,14 +93,14 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
:params => 'File content', :params => 'File content',
:headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith')) :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
token = Attachment.last.token token = Attachment.last.token
payload = <<-JSON payload = <<~JSON
{ "file": { { "file": {
"filename": "New filename", "filename": "New filename",
"description": "New description", "description": "New description",
"content_type": "application/txt", "content_type": "application/txt",
"token": "#{token}" "token": "#{token}"
} }
} }
JSON JSON
post '/projects/1/files.json', post '/projects/1/files.json',
:params => payload, :params => payload,
@@ -117,14 +117,14 @@ class Redmine::ApiTest::FilesTest < Redmine::ApiTest::Base
:params => 'File content', :params => 'File content',
:headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith')) :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith'))
token = Attachment.last.token token = Attachment.last.token
payload = <<-JSON payload = <<~JSON
{ "file": { { "file": {
"version_id": 3, "version_id": 3,
"filename": "New filename", "filename": "New filename",
"description": "New description", "description": "New description",
"token": "#{token}" "token": "#{token}"
} }
} }
JSON JSON
post '/projects/1/files.json', post '/projects/1/files.json',
:params => payload, :params => payload,