diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-19 14:13:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-19 14:13:10 +0000 |
commit | 7bd8280a83290e144b19c7ac614952d430e3e4b1 (patch) | |
tree | 14a9c754c93613a2c61f99a1a04f726325822401 /test/object_helpers.rb | |
parent | a9d7f32da347a382d2f130cbc13187505f370fc7 (diff) | |
download | redmine-7bd8280a83290e144b19c7ac614952d430e3e4b1.tar.gz redmine-7bd8280a83290e144b19c7ac614952d430e3e4b1.zip |
Adds settings for time entry hours validation (#24005).
git-svn-id: http://svn.redmine.org/redmine/trunk@16832 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r-- | test/object_helpers.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb index f827cd150..ce38356a9 100644 --- a/test/object_helpers.rb +++ b/test/object_helpers.rb @@ -139,7 +139,7 @@ module ObjectHelpers version end - def TimeEntry.generate!(attributes={}) + def TimeEntry.generate(attributes={}) entry = TimeEntry.new(attributes) entry.user ||= User.find(2) entry.issue ||= Issue.find(1) unless entry.project @@ -147,6 +147,11 @@ module ObjectHelpers entry.activity ||= TimeEntryActivity.first entry.spent_on ||= Date.today entry.hours ||= 1.0 + entry + end + + def TimeEntry.generate!(attributes={}, &block) + entry = TimeEntry.generate(attributes, &block) entry.save! entry end |