Browse Source

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

git-svn-id: http://svn.redmine.org/redmine/trunk@19204 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.2.0
Toshi MARUYAMA 4 years ago
parent
commit
bd0f849e08
1 changed files with 18 additions and 8 deletions
  1. 18
    8
      test/unit/issue_test.rb

+ 18
- 8
test/unit/issue_test.rb View File

@@ -945,9 +945,17 @@ class IssueTest < ActiveSupport::TestCase
assert_equal [cf2.id.to_s], issue.read_only_attribute_names(user)
assert_not_include cf2.id.to_s, issue.safe_attribute_names(user)

issue.send :safe_attributes=, {'custom_field_values' => {
cf1.id.to_s => 'value1', cf2.id.to_s => 'value2'
}}, user
issue.send(
:safe_attributes=,
{
'custom_field_values' =>
{
cf1.id.to_s => 'value1',
cf2.id.to_s => 'value2'
}
},
user
)
assert_equal 'value1', issue.custom_field_value(cf1)
assert_nil issue.custom_field_value(cf2)

@@ -2960,11 +2968,13 @@ class IssueTest < ActiveSupport::TestCase
def test_save_attachments_with_hash_should_save_attachments_in_keys_order
set_tmp_attachments_directory
issue = Issue.generate!
issue.save_attachments({
'p0' => {'file' => mock_file_with_options(:original_filename => 'upload')},
'3' => {'file' => mock_file_with_options(:original_filename => 'bar')},
'1' => {'file' => mock_file_with_options(:original_filename => 'foo')}
})
issue.save_attachments(
{
'p0' => {'file' => mock_file_with_options(:original_filename => 'upload')},
'3' => {'file' => mock_file_with_options(:original_filename => 'bar')},
'1' => {'file' => mock_file_with_options(:original_filename => 'foo')}
}
)
issue.attach_saved_attachments

assert_equal 3, issue.reload.attachments.count

Loading…
Cancel
Save