diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-05 19:56:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-05 19:56:59 +0000 |
commit | 8cea7d8cf213174d282db85ef5e16832c9845501 (patch) | |
tree | 25729db612b245df31ea14a6abc2f6ada419327c /test/object_helpers.rb | |
parent | 6327bdc6f871e9fa931a61615ec62c086d93dbbe (diff) | |
download | redmine-8cea7d8cf213174d282db85ef5e16832c9845501.tar.gz redmine-8cea7d8cf213174d282db85ef5e16832c9845501.zip |
Don't validate start date when updating an issue without changing it (#14086).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11931 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r-- | test/object_helpers.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb index 2f29793f2..2f7559249 100644 --- a/test/object_helpers.rb +++ b/test/object_helpers.rb @@ -65,13 +65,20 @@ module ObjectHelpers role end - def Issue.generate!(attributes={}) + # Generates an unsaved Issue + def Issue.generate(attributes={}) issue = Issue.new(attributes) issue.project ||= Project.find(1) issue.tracker ||= issue.project.trackers.first issue.subject = 'Generated' if issue.subject.blank? issue.author ||= User.find(2) yield issue if block_given? + issue + end + + # Generates a saved Issue + def Issue.generate!(attributes={}, &block) + issue = Issue.generate(attributes, &block) issue.save! issue end |