summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-10 13:34:46 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-10 13:34:46 +0000
commit4daf3aa0249a9fa24aeb32503b0aee138ae90d43 (patch)
tree58a72b9c836b3a916f0ba527fc093092a4198680
parentc03cb9e135ca70f2430dd45363c88662c6575d29 (diff)
downloadredmine-4daf3aa0249a9fa24aeb32503b0aee138ae90d43.tar.gz
redmine-4daf3aa0249a9fa24aeb32503b0aee138ae90d43.zip
shorten long line of test/unit/time_entry_activity_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20615 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/time_entry_activity_test.rb29
1 files changed, 24 insertions, 5 deletions
diff --git a/test/unit/time_entry_activity_test.rb b/test/unit/time_entry_activity_test.rb
index c1a081d48..b1de7378e 100644
--- a/test/unit/time_entry_activity_test.rb
+++ b/test/unit/time_entry_activity_test.rb
@@ -102,8 +102,9 @@ class TimeEntryActivityTest < ActiveSupport::TestCase
def test_system_activity_with_child_in_use_should_be_in_use
project = Project.generate!
system_activity = TimeEntryActivity.create!(:name => 'Activity')
- project_activity = TimeEntryActivity.create!(:name => 'Activity', :project => project, :parent_id => system_activity.id)
-
+ project_activity =
+ TimeEntryActivity.create!(:name => 'Activity', :project => project,
+ :parent_id => system_activity.id)
TimeEntry.generate!(:project => project, :activity => project_activity)
assert project_activity.in_use?
@@ -115,7 +116,9 @@ class TimeEntryActivityTest < ActiveSupport::TestCase
entries = []
system_activity = TimeEntryActivity.create!(:name => 'Activity')
entries << TimeEntry.generate!(:project => project, :activity => system_activity)
- project_activity = TimeEntryActivity.create!(:name => 'Activity', :project => project, :parent_id => system_activity.id)
+ project_activity =
+ TimeEntryActivity.create!(:name => 'Activity', :project => project,
+ :parent_id => system_activity.id)
entries << TimeEntry.generate!(:project => project.reload, :activity => project_activity)
assert_difference 'TimeEntryActivity.count', -2 do
assert_nothing_raised do
@@ -136,13 +139,29 @@ class TimeEntryActivityTest < ActiveSupport::TestCase
project = Project.find(1)
parent_activity = TimeEntryActivity.find_by(position: 3, parent_id: nil)
- project.update_or_create_time_entry_activities({parent_activity.id.to_s => {'parent_id' => parent_activity.id.to_s, 'active' => '0', 'custom_field_values' => {'7' => ''}}})
+ project.update_or_create_time_entry_activities(
+ {
+ parent_activity.id.to_s => {
+ 'parent_id' => parent_activity.id.to_s,
+ 'active' => '0',
+ 'custom_field_values' => {'7' => ''}
+ }
+ }
+ )
project_activity = TimeEntryActivity.find_by(position: 3, parent_id: parent_activity.id, project_id: 1)
assert_equal parent_activity.position, project_activity.position
# Changing the position of the parent activity also changes the position of the activity in each project.
other_parent_activity = TimeEntryActivity.find_by(position: 4, parent_id: nil)
- project.update_or_create_time_entry_activities({other_parent_activity.id.to_s => {'parent_id' => other_parent_activity.id.to_s, 'active' => '0', 'custom_field_values' => {'7' => ''}}})
+ project.update_or_create_time_entry_activities(
+ {
+ other_parent_activity.id.to_s => {
+ 'parent_id' => other_parent_activity.id.to_s,
+ 'active' => '0',
+ 'custom_field_values' => {'7' => ''}
+ }
+ }
+ )
other_project_activity = TimeEntryActivity.find_by(position: 4, parent_id: other_parent_activity.id, project_id: 1)
parent_activity.update(position: 4)