summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_import_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-12 12:31:58 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-12 12:31:58 +0000
commit8e95e56e26d941cc0f8b4f0260172ac5f8d83ff4 (patch)
treed20206ad6eedbc9f78d30ce8400e69eecfdcbb60 /test/unit/issue_import_test.rb
parent0468fe6545d5f7a8710462817483c7b30d0c53aa (diff)
downloadredmine-8e95e56e26d941cc0f8b4f0260172ac5f8d83ff4.tar.gz
redmine-8e95e56e26d941cc0f8b4f0260172ac5f8d83ff4.zip
remove spaces inside {} of test/unit/issue_import_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20347 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r--test/unit/issue_import_test.rb82
1 files changed, 41 insertions, 41 deletions
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb
index 1328c3bca..1fd38685e 100644
--- a/test/unit/issue_import_test.rb
+++ b/test/unit/issue_import_test.rb
@@ -78,7 +78,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['tracker'] = 'value:2'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal [2], issues.map(&:tracker_id).uniq
end
@@ -87,7 +87,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['tracker'] = '13'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal [1, 2, 1], issues.map(&:tracker_id)
end
@@ -109,7 +109,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['status'] = '14'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal ['New', 'New', 'Assigned'], issues.map(&:status).map(&:name)
end
@@ -118,7 +118,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['parent_issue_id'] = '5'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_nil issues[0].parent
assert_equal issues[0].id, issues[1].parent_id
assert_equal 2, issues[2].parent_id
@@ -129,7 +129,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.settings['encoding'] = 'UTF-8'
import.save
- issues = new_records(Issue,3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal 3, issues.count
end
@@ -141,7 +141,7 @@ class IssueImportTest < ActiveSupport::TestCase
}
import.save!
- root, child1, grandchild, child2 = new_records(Issue, 4) { import.run }
+ root, child1, grandchild, child2 = new_records(Issue, 4) {import.run}
assert_equal root, child1.parent
assert_equal child2, grandchild.parent
end
@@ -151,7 +151,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.settings['mapping'] = {'project_id' => '1', 'unique_id' => '0', 'tracker' => '1', 'subject' => '2', 'parent_issue_id' => '3', 'relation_follows' => '4'}
import.save!
- red4, red3, red2, red1, blue1, blue2, blue3, blue4, green = new_records(Issue, 9) { import.run }
+ red4, red3, red2, red1, blue1, blue2, blue3, blue4, green = new_records(Issue, 9) {import.run}
# future references
assert_equal red1, red2.parent
@@ -174,26 +174,26 @@ class IssueImportTest < ActiveSupport::TestCase
import.settings['mapping'] = {'project_id' => '1', 'tracker' => '1', 'subject' => '2', 'relation_relates' => '4'}
import.save!
- one, one_one, one_two_one, one_two = new_records(Issue, 4) { import.run }
+ one, one_one, one_two_one, one_two = new_records(Issue, 4) {import.run}
assert_equal 2, one.relations.count
- assert one.relations.all? { |r| r.relation_type == 'relates' }
- assert one.relations.any? { |r| r.other_issue(one) == one_one }
- assert one.relations.any? { |r| r.other_issue(one) == one_two }
+ assert one.relations.all? {|r| r.relation_type == 'relates'}
+ assert one.relations.any? {|r| r.other_issue(one) == one_one}
+ assert one.relations.any? {|r| r.other_issue(one) == one_two}
assert_equal 2, one_one.relations.count
- assert one_one.relations.all? { |r| r.relation_type == 'relates' }
- assert one_one.relations.any? { |r| r.other_issue(one_one) == one }
- assert one_one.relations.any? { |r| r.other_issue(one_one) == one_two }
+ assert one_one.relations.all? {|r| r.relation_type == 'relates'}
+ assert one_one.relations.any? {|r| r.other_issue(one_one) == one}
+ assert one_one.relations.any? {|r| r.other_issue(one_one) == one_two}
assert_equal 3, one_two.relations.count
- assert one_two.relations.all? { |r| r.relation_type == 'relates' }
- assert one_two.relations.any? { |r| r.other_issue(one_two) == one }
- assert one_two.relations.any? { |r| r.other_issue(one_two) == one_one }
- assert one_two.relations.any? { |r| r.other_issue(one_two) == one_two_one }
+ assert one_two.relations.all? {|r| r.relation_type == 'relates'}
+ assert one_two.relations.any? {|r| r.other_issue(one_two) == one}
+ assert one_two.relations.any? {|r| r.other_issue(one_two) == one_one}
+ assert one_two.relations.any? {|r| r.other_issue(one_two) == one_two_one}
assert_equal 1, one_two_one.relations.count
- assert one_two_one.relations.all? { |r| r.relation_type == 'relates' }
- assert one_two_one.relations.any? { |r| r.other_issue(one_two_one) == one_two }
+ assert one_two_one.relations.all? {|r| r.relation_type == 'relates'}
+ assert one_two_one.relations.any? {|r| r.other_issue(one_two_one) == one_two}
end
def test_delayed_relation
@@ -201,28 +201,28 @@ class IssueImportTest < ActiveSupport::TestCase
import.settings['mapping'] = {'project_id' => '1', 'tracker' => '1', 'subject' => '2', 'relation_precedes' => '5'}
import.save!
- one, one_one, one_two_one, one_two = new_records(Issue, 4) { import.run }
+ one, one_one, one_two_one, one_two = new_records(Issue, 4) {import.run}
assert_equal 2, one.relations_to.count
- assert one.relations_to.all? { |r| r.relation_type == 'precedes' }
- assert one.relations_to.any? { |r| r.issue_from == one_one && r.delay == 2 }
- assert one.relations_to.any? { |r| r.issue_from == one_two && r.delay == 1 }
+ assert one.relations_to.all? {|r| r.relation_type == 'precedes'}
+ assert one.relations_to.any? {|r| r.issue_from == one_one && r.delay == 2}
+ assert one.relations_to.any? {|r| r.issue_from == one_two && r.delay == 1}
assert_equal 1, one_one.relations_from.count
- assert one_one.relations_from.all? { |r| r.relation_type == 'precedes' }
- assert one_one.relations_from.any? { |r| r.issue_to == one && r.delay == 2 }
+ assert one_one.relations_from.all? {|r| r.relation_type == 'precedes'}
+ assert one_one.relations_from.any? {|r| r.issue_to == one && r.delay == 2}
assert_equal 1, one_two.relations_to.count
- assert one_two.relations_to.all? { |r| r.relation_type == 'precedes' }
- assert one_two.relations_to.any? { |r| r.issue_from == one_two_one && r.delay == -1 }
+ assert one_two.relations_to.all? {|r| r.relation_type == 'precedes'}
+ assert one_two.relations_to.any? {|r| r.issue_from == one_two_one && r.delay == -1}
assert_equal 1, one_two.relations_from.count
- assert one_two.relations_from.all? { |r| r.relation_type == 'precedes' }
- assert one_two.relations_from.any? { |r| r.issue_to == one && r.delay == 1 }
+ assert one_two.relations_from.all? {|r| r.relation_type == 'precedes'}
+ assert one_two.relations_from.any? {|r| r.issue_to == one && r.delay == 1}
assert_equal 1, one_two_one.relations_from.count
- assert one_two_one.relations_from.all? { |r| r.relation_type == 'precedes' }
- assert one_two_one.relations_from.any? { |r| r.issue_to == one_two && r.delay == -1 }
+ assert one_two_one.relations_from.all? {|r| r.relation_type == 'precedes'}
+ assert one_two_one.relations_from.any? {|r| r.issue_to == one_two && r.delay == -1}
end
def test_parent_and_follows_relation
@@ -239,7 +239,7 @@ class IssueImportTest < ActiveSupport::TestCase
}
import.save!
- second, first, parent, third = assert_difference('IssueRelation.count', 2) { new_records(Issue, 4) { import.run } }
+ second, first, parent, third = assert_difference('IssueRelation.count', 2) {new_records(Issue, 4) {import.run}}
# Parent relations
assert_equal parent, first.parent
@@ -278,7 +278,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['assigned_to'] = '11'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal [User.find(3), nil, nil], issues.map(&:assigned_to)
end
@@ -288,7 +288,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping["cf_#{field.id}"] = '11'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal '3', issues.first.custom_field_value(field)
end
@@ -300,7 +300,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping["cf_1"] = '8'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal 'PostgreSQL', issues[0].custom_field_value(1)
assert_equal 'MySQL', issues[1].custom_field_value(1)
assert_equal '', issues.third.custom_field_value(1)
@@ -315,7 +315,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping["cf_1"] = '15'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal ['Oracle', 'PostgreSQL'], issues[0].custom_field_value(1).sort
assert_equal ['MySQL'], issues[1].custom_field_value(1)
assert_equal [''], issues.third.custom_field_value(1)
@@ -326,7 +326,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['is_private'] = '6'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert_equal [false, true, false], issues.map(&:is_private)
end
@@ -337,7 +337,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping.merge!('tracker' => 'value:1', 'subject' => '0', 'start_date' => '1', 'due_date' => '2', "cf_#{field.id}" => '3')
import.save!
- issue = new_record(Issue) { import.run } # only 1 valid issue
+ issue = new_record(Issue) {import.run} # only 1 valid issue
assert_equal "Valid dates", issue.subject
assert_equal Date.parse('2015-07-10'), issue.start_date
assert_equal Date.parse('2015-08-12'), issue.due_date
@@ -349,7 +349,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping.merge!('tracker' => 'value:1', 'subject' => '0', 'start_date' => '1')
import.save!
- issue = new_record(Issue) { import.run }
+ issue = new_record(Issue) {import.run}
assert_equal Date.parse('2019-05-28'), issue.start_date
end
@@ -380,7 +380,7 @@ class IssueImportTest < ActiveSupport::TestCase
import.mapping['fixed_version'] = '9'
import.save!
- issues = new_records(Issue, 3) { import.run }
+ issues = new_records(Issue, 3) {import.run}
assert [nil, 3, system_version.id], issues.map(&:fixed_version_id)
end