diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-09-21 20:32:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-09-21 20:32:11 +0000 |
commit | 64a80066bd8681f477f675a960f2b258c285044c (patch) | |
tree | 72f38eeb36302ce61035a5135a0b1496e7a6d590 /test/object_helpers.rb | |
parent | aa096cb0cc96c0b7f12274dcf7bbd3d8e3e44948 (diff) | |
download | redmine-64a80066bd8681f477f675a960f2b258c285044c.tar.gz redmine-64a80066bd8681f477f675a960f2b258c285044c.zip |
Error message when editing a child project without add project/subprojects permissions (#20282).
git-svn-id: http://svn.redmine.org/redmine/trunk@14619 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r-- | test/object_helpers.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb index 82d8d20fc..905ab0998 100644 --- a/test/object_helpers.rb +++ b/test/object_helpers.rb @@ -39,7 +39,10 @@ module ObjectHelpers project end - def Project.generate_with_parent!(parent, attributes={}) + def Project.generate_with_parent!(*args) + attributes = args.last.is_a?(Hash) ? args.pop : {} + parent = args.size > 0 ? args.first : Project.generate! + project = Project.generate!(attributes) do |p| p.parent = parent end |