diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-31 17:17:52 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-31 17:17:52 +0000 |
commit | bc153cb61df37e2097c5bec529cabdb15e6887bf (patch) | |
tree | 05be0525dc3258c00349e7cc6b5ab333ca4139c0 /test/object_helpers.rb | |
parent | 9554f0133ff634264eb110c91ad317be28e6dd32 (diff) | |
download | redmine-bc153cb61df37e2097c5bec529cabdb15e6887bf.tar.gz redmine-bc153cb61df37e2097c5bec529cabdb15e6887bf.zip |
Support for subforums (#3831).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10142 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r-- | test/object_helpers.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb index a2d7c958f..85c6d139c 100644 --- a/test/object_helpers.rb +++ b/test/object_helpers.rb @@ -99,4 +99,15 @@ module ObjectHelpers source.save! source end + + def Board.generate!(attributes={}) + @generated_board_name ||= 'Forum 0' + @generated_board_name.succ! + board = Board.new(attributes) + board.name = @generated_board_name if board.name.blank? + board.description = @generated_board_name if board.description.blank? + yield board if block_given? + board.save! + board + end end |