summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-01 17:10:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-01 17:10:15 +0000
commitc5ac2d3966c2ac04a2580fca67a40acf24b51239 (patch)
tree45f8eca2133899ea2bd8fd4841e14adb4709fc85 /test/object_helpers.rb
parent6c39a260a3c44c1d121a7421b1d6c09358da20a1 (diff)
downloadredmine-c5ac2d3966c2ac04a2580fca67a40acf24b51239.tar.gz
redmine-c5ac2d3966c2ac04a2580fca67a40acf24b51239.zip
Fixed that deleting a system activity with children in use raises an error (#13783).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11763 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 8c82a328b..2f29793f2 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -107,10 +107,11 @@ module ObjectHelpers
def TimeEntry.generate!(attributes={})
entry = TimeEntry.new(attributes)
entry.user ||= User.find(2)
- entry.issue ||= Issue.find(1)
+ entry.issue ||= Issue.find(1) unless entry.project
entry.project ||= entry.issue.project
entry.activity ||= TimeEntryActivity.first
entry.spent_on ||= Date.today
+ entry.hours ||= 1.0
entry.save!
entry
end