cleanup: rubocop: fix Layout/IndentFirstArrayElement in test/unit/issue_test.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@19242 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2019-11-24 05:44:51 +00:00
parent b4fc7d45a6
commit 3f6d9f74f7
2 changed files with 11 additions and 8 deletions

View File

@@ -156,7 +156,6 @@ Layout/IndentFirstArrayElement:
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb' - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
- 'test/functional/auth_sources_controller_test.rb' - 'test/functional/auth_sources_controller_test.rb'
- 'test/functional/repositories_mercurial_controller_test.rb' - 'test/functional/repositories_mercurial_controller_test.rb'
- 'test/unit/issue_test.rb'
- 'test/unit/lib/redmine/scm/adapters/git_adapter_test.rb' - 'test/unit/lib/redmine/scm/adapters/git_adapter_test.rb'
- 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb' - 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb'
- 'test/unit/project_test.rb' - 'test/unit/project_test.rb'

View File

@@ -959,10 +959,16 @@ class IssueTest < ActiveSupport::TestCase
assert_equal 'value1', issue.custom_field_value(cf1) assert_equal 'value1', issue.custom_field_value(cf1)
assert_nil issue.custom_field_value(cf2) assert_nil issue.custom_field_value(cf2)
issue.send :safe_attributes=, {'custom_fields' => [ issue.send(
:safe_attributes=,
{
'custom_fields' =>
[
{'id' => cf1.id.to_s, 'value' => 'valuea'}, {'id' => cf1.id.to_s, 'value' => 'valuea'},
{'id' => cf2.id.to_s, 'value' => 'valueb'} {'id' => cf2.id.to_s, 'value' => 'valueb'}
]}, user ]
}, user
)
assert_equal 'valuea', issue.custom_field_value(cf1) assert_equal 'valuea', issue.custom_field_value(cf1)
assert_nil issue.custom_field_value(cf2) assert_nil issue.custom_field_value(cf2)
end end
@@ -2986,9 +2992,7 @@ class IssueTest < ActiveSupport::TestCase
def test_save_attachments_with_array_should_warn_about_missing_tokens def test_save_attachments_with_array_should_warn_about_missing_tokens
set_tmp_attachments_directory set_tmp_attachments_directory
issue = Issue.generate! issue = Issue.generate!
issue.save_attachments([ issue.save_attachments([{'token' => 'missing'}])
{'token' => 'missing'}
])
assert !issue.save assert !issue.save
assert issue.errors[:base].present? assert issue.errors[:base].present?
assert_equal 0, issue.reload.attachments.count assert_equal 0, issue.reload.attachments.count