summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb11
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