diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-01-27 18:29:03 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-01-27 18:29:03 +0000 |
commit | 9044305b9335bb74f607944ffb3d6dd483da8f0b (patch) | |
tree | 646cd39bba4dfd5b5b08469c9fa01d53627ef6b6 /test/exemplars/wiki_page_exemplar.rb | |
parent | d1c90d9abfd54dfa815e3401ce60af1e288ab122 (diff) | |
download | redmine-9044305b9335bb74f607944ffb3d6dd483da8f0b.tar.gz redmine-9044305b9335bb74f607944ffb3d6dd483da8f0b.zip |
Added some exemplars for object daddy to generate test data.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3340 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/exemplars/wiki_page_exemplar.rb')
-rw-r--r-- | test/exemplars/wiki_page_exemplar.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/exemplars/wiki_page_exemplar.rb b/test/exemplars/wiki_page_exemplar.rb new file mode 100644 index 000000000..d70cc2278 --- /dev/null +++ b/test/exemplars/wiki_page_exemplar.rb @@ -0,0 +1,14 @@ +class WikiPage < ActiveRecord::Base + generator_for :title, :method => :next_title + generator_for :wiki, :method => :generate_wiki + + def self.next_title + @last_title ||= 'AWikiPage' + @last_title.succ! + @last_title + end + + def self.generate_wiki + Wiki.generate! + end +end |