diff --git a/test/exemplars/attachment_exemplar.rb b/test/exemplars/attachment_exemplar.rb deleted file mode 100644 index 4baaf530f..000000000 --- a/test/exemplars/attachment_exemplar.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Attachment < ActiveRecord::Base - generator_for :container, :method => :generate_project - generator_for :file, :method => :generate_file - generator_for :author, :method => :generate_author - - def self.generate_project - Project.generate! - end - - def self.generate_author - User.generate_with_protected! - end - - def self.generate_file - @file = ActiveSupport::TestCase.mock_file - end -end diff --git a/test/exemplars/auth_source_exemplar.rb b/test/exemplars/auth_source_exemplar.rb deleted file mode 100644 index 3976aebb8..000000000 --- a/test/exemplars/auth_source_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class AuthSource < ActiveRecord::Base - generator_for :name, :start => 'Auth0' - -end diff --git a/test/exemplars/board_exemplar.rb b/test/exemplars/board_exemplar.rb deleted file mode 100644 index eb8643dcd..000000000 --- a/test/exemplars/board_exemplar.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Board < ActiveRecord::Base - generator_for :name, :start => 'A Forum' - generator_for :description, :start => 'Some description here' - generator_for :project, :method => :generate_project - - def self.generate_project - Project.generate! - end -end diff --git a/test/exemplars/change_exemplar.rb b/test/exemplars/change_exemplar.rb deleted file mode 100644 index 07f30ecef..000000000 --- a/test/exemplars/change_exemplar.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Change < ActiveRecord::Base - generator_for :action => 'A' - generator_for :path, :start => 'test/dir/aaa0001' - generator_for :changeset, :method => :generate_changeset - - def self.generate_changeset - Changeset.generate! - end -end diff --git a/test/exemplars/changeset_exemplar.rb b/test/exemplars/changeset_exemplar.rb deleted file mode 100644 index 62d6ee34c..000000000 --- a/test/exemplars/changeset_exemplar.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Changeset < ActiveRecord::Base - generator_for :revision, :start => '1' - generator_for :committed_on => Date.today - generator_for :repository, :method => :generate_repository - - def self.generate_repository - Repository::Subversion.generate! - end -end diff --git a/test/exemplars/comment_exemplar.rb b/test/exemplars/comment_exemplar.rb deleted file mode 100644 index 036e82756..000000000 --- a/test/exemplars/comment_exemplar.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Comment < ActiveRecord::Base - generator_for :commented, :method => :generate_news - generator_for :author, :method => :generate_author - generator_for :comments => 'What great news this is.' - - def self.generate_news - News.generate! - end - - def self.generate_author - User.generate_with_protected! - end -end diff --git a/test/exemplars/custom_field_exemplar.rb b/test/exemplars/custom_field_exemplar.rb deleted file mode 100644 index 81e77884d..000000000 --- a/test/exemplars/custom_field_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class CustomField < ActiveRecord::Base - generator_for :name, :start => 'CustomField0' - generator_for :field_format => 'string' - -end diff --git a/test/exemplars/custom_value_exemplar.rb b/test/exemplars/custom_value_exemplar.rb deleted file mode 100644 index aeb5412e1..000000000 --- a/test/exemplars/custom_value_exemplar.rb +++ /dev/null @@ -1,7 +0,0 @@ -class CustomValue < ActiveRecord::Base - generator_for :custom_field, :method => :generate_custom_field - - def self.generate_custom_field - CustomField.generate! - end -end diff --git a/test/exemplars/document_category_exemplar.rb b/test/exemplars/document_category_exemplar.rb deleted file mode 100644 index 758b6d4c1..000000000 --- a/test/exemplars/document_category_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class DocumentCategory < Enumeration - generator_for :name, :start => 'DocumentCategory0' - generator_for :type => 'DocumentCategory' - -end diff --git a/test/exemplars/document_exemplar.rb b/test/exemplars/document_exemplar.rb deleted file mode 100644 index 1d8e71028..000000000 --- a/test/exemplars/document_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Document < ActiveRecord::Base - generator_for :title, :start => 'Document001' - -end diff --git a/test/exemplars/enabled_module_exemplar.rb b/test/exemplars/enabled_module_exemplar.rb deleted file mode 100644 index 60f0631cf..000000000 --- a/test/exemplars/enabled_module_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class EnabledModule < ActiveRecord::Base - generator_for :name, :start => 'module_001' - -end diff --git a/test/exemplars/enumeration_exemplar.rb b/test/exemplars/enumeration_exemplar.rb deleted file mode 100644 index 29e4f45d4..000000000 --- a/test/exemplars/enumeration_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Enumeration < ActiveRecord::Base - generator_for :name, :start => 'Enumeration0' - generator_for :type => 'TimeEntryActivity' - -end diff --git a/test/exemplars/group_exemplar.rb b/test/exemplars/group_exemplar.rb deleted file mode 100644 index a6851b422..000000000 --- a/test/exemplars/group_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Group < Principal - generator_for :lastname, :start => 'Group' - -end diff --git a/test/exemplars/issue_category_exemplar.rb b/test/exemplars/issue_category_exemplar.rb deleted file mode 100644 index 246eafcfb..000000000 --- a/test/exemplars/issue_category_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class IssueCategory < ActiveRecord::Base - generator_for :name, :start => 'Category 0001' - -end diff --git a/test/exemplars/issue_exemplar.rb b/test/exemplars/issue_exemplar.rb deleted file mode 100644 index 17868e6a4..000000000 --- a/test/exemplars/issue_exemplar.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Issue < ActiveRecord::Base - generator_for :subject, :start => 'Subject 0' - generator_for :author, :method => :next_author - generator_for :priority, :method => :fetch_priority - - def self.next_author - User.generate_with_protected! - end - - def self.fetch_priority - IssuePriority.first || IssuePriority.generate! - end -end diff --git a/test/exemplars/issue_priority_exemplar.rb b/test/exemplars/issue_priority_exemplar.rb deleted file mode 100644 index 5059da5a1..000000000 --- a/test/exemplars/issue_priority_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class IssuePriority < Enumeration - generator_for :name, :start => 'IssuePriority0' - generator_for :type => 'IssuePriority' - -end diff --git a/test/exemplars/issue_status_exemplar.rb b/test/exemplars/issue_status_exemplar.rb deleted file mode 100644 index 0576568dd..000000000 --- a/test/exemplars/issue_status_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class IssueStatus < ActiveRecord::Base - generator_for :name, :start => 'Status 0' - -end diff --git a/test/exemplars/journal_exemplar.rb b/test/exemplars/journal_exemplar.rb deleted file mode 100644 index dbb66f203..000000000 --- a/test/exemplars/journal_exemplar.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Journal < ActiveRecord::Base - generator_for :journalized, :method => :generate_issue - generator_for :user, :method => :generate_user - - def self.generate_issue - project = Project.generate! - Issue.generate_for_project!(project) - end - - def self.generate_user - User.generate_with_protected! - end -end diff --git a/test/exemplars/member_exemplar.rb b/test/exemplars/member_exemplar.rb deleted file mode 100644 index ecb09bb91..000000000 --- a/test/exemplars/member_exemplar.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Member < ActiveRecord::Base - generator_for :roles, :method => :generate_roles - generator_for :principal, :method => :generate_user - - def self.generate_roles - [Role.generate!] - end - - def self.generate_user - User.generate_with_protected! - end -end diff --git a/test/exemplars/member_role_exemplar.rb b/test/exemplars/member_role_exemplar.rb deleted file mode 100644 index 0e1e6e70c..000000000 --- a/test/exemplars/member_role_exemplar.rb +++ /dev/null @@ -1,12 +0,0 @@ -class MemberRole < ActiveRecord::Base - generator_for :member, :method => :generate_member - generator_for :role, :method => :generate_role - - def self.generate_role - Role.generate! - end - - def self.generate_member - Member.generate! - end -end diff --git a/test/exemplars/message_exemplar.rb b/test/exemplars/message_exemplar.rb deleted file mode 100644 index 67c5b67e2..000000000 --- a/test/exemplars/message_exemplar.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Message < ActiveRecord::Base - generator_for :subject, :start => 'A Message' - generator_for :content, :start => 'Some content here' - generator_for :board, :method => :generate_board - - def self.generate_board - Board.generate! - end -end diff --git a/test/exemplars/news_exemplar.rb b/test/exemplars/news_exemplar.rb deleted file mode 100644 index d58a2924f..000000000 --- a/test/exemplars/news_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class News < ActiveRecord::Base - generator_for :title, :start => 'A New Item' - generator_for :description, :start => 'Some content here' - -end diff --git a/test/exemplars/project_exemplar.rb b/test/exemplars/project_exemplar.rb deleted file mode 100644 index ceda2be29..000000000 --- a/test/exemplars/project_exemplar.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Project < ActiveRecord::Base - generator_for :name, :start => 'Project 0' - generator_for :identifier, :start => 'project-0000' - generator_for :enabled_modules, :method => :all_modules - generator_for :trackers, :method => :next_tracker - - def self.all_modules - [].tap do |modules| - Redmine::AccessControl.available_project_modules.each do |name| - modules << EnabledModule.new(:name => name.to_s) - end - end - end - - def self.next_tracker - [Tracker.generate!] - end -end diff --git a/test/exemplars/query_exemplar.rb b/test/exemplars/query_exemplar.rb deleted file mode 100644 index 2b0847c80..000000000 --- a/test/exemplars/query_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Query < ActiveRecord::Base - generator_for :name, :start => 'Query 0' - -end diff --git a/test/exemplars/repository_exemplar.rb b/test/exemplars/repository_exemplar.rb deleted file mode 100644 index 961bee7ae..000000000 --- a/test/exemplars/repository_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Repository < ActiveRecord::Base - generator_for :type => 'Subversion' - generator_for :url, :start => 'file:///test/svn' - generator_for :identifier, :start => 'repo1' -end diff --git a/test/exemplars/role_exemplar.rb b/test/exemplars/role_exemplar.rb deleted file mode 100644 index 00bad9212..000000000 --- a/test/exemplars/role_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Role < ActiveRecord::Base - generator_for :name, :start => 'Role0' - -end diff --git a/test/exemplars/subversion_repository_exemplar.rb b/test/exemplars/subversion_repository_exemplar.rb deleted file mode 100644 index 93c9fd161..000000000 --- a/test/exemplars/subversion_repository_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Repository::Subversion < Repository - generator_for :type, :method => 'Subversion' - generator_for :url, :start => 'file:///test/svn' - -end diff --git a/test/exemplars/time_entry_activity.rb b/test/exemplars/time_entry_activity.rb deleted file mode 100644 index e5e318d74..000000000 --- a/test/exemplars/time_entry_activity.rb +++ /dev/null @@ -1,5 +0,0 @@ -class TimeEntryActivity < Enumeration - generator_for :name, :start => 'TimeEntryActivity0' - generator_for :type => 'TimeEntryActivity' - -end diff --git a/test/exemplars/time_entry_exemplar.rb b/test/exemplars/time_entry_exemplar.rb deleted file mode 100644 index c8f2e203c..000000000 --- a/test/exemplars/time_entry_exemplar.rb +++ /dev/null @@ -1,9 +0,0 @@ -class TimeEntry < ActiveRecord::Base - generator_for(:spent_on) { Date.today } - generator_for(:hours) { (rand * 10).round(2) } # 0.01 to 9.99 - generator_for :user, :method => :generate_user - - def self.generate_user - User.generate_with_protected! - end -end diff --git a/test/exemplars/tracker_exemplar.rb b/test/exemplars/tracker_exemplar.rb deleted file mode 100644 index 0aa0d3b94..000000000 --- a/test/exemplars/tracker_exemplar.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Tracker < ActiveRecord::Base - generator_for :name, :start => 'Tracker 0' - -end diff --git a/test/exemplars/user_exemplar.rb b/test/exemplars/user_exemplar.rb deleted file mode 100644 index 7aee14531..000000000 --- a/test/exemplars/user_exemplar.rb +++ /dev/null @@ -1,12 +0,0 @@ -class User < Principal - generator_for :login, :start => 'user1' - generator_for :mail, :method => :next_email - generator_for :firstname, :start => 'Bob' - generator_for :lastname, :start => 'Doe' - - def self.next_email - @last_email ||= 'user1' - @last_email.succ! - "#{@last_email}@example.com" - end -end diff --git a/test/exemplars/version_exemplar.rb b/test/exemplars/version_exemplar.rb deleted file mode 100644 index 14a9dd17f..000000000 --- a/test/exemplars/version_exemplar.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Version < ActiveRecord::Base - generator_for :name, :start => 'Version 1.0.0' - generator_for :status => 'open' - -end diff --git a/test/exemplars/watcher_exemplar.rb b/test/exemplars/watcher_exemplar.rb deleted file mode 100644 index 4d6c26651..000000000 --- a/test/exemplars/watcher_exemplar.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Watcher < ActiveRecord::Base - generator_for :user, :method => :generate_user - - def self.generate_user - User.generate_with_protected! - end -end diff --git a/test/exemplars/wiki_content_exemplar.rb b/test/exemplars/wiki_content_exemplar.rb deleted file mode 100644 index 79465b0ea..000000000 --- a/test/exemplars/wiki_content_exemplar.rb +++ /dev/null @@ -1,8 +0,0 @@ -class WikiContent < ActiveRecord::Base - generator_for :text => 'Some content' - generator_for :page, :method => :generate_page - - def self.generate_page - WikiPage.generate! - end -end diff --git a/test/exemplars/wiki_exemplar.rb b/test/exemplars/wiki_exemplar.rb deleted file mode 100644 index 65b93a233..000000000 --- a/test/exemplars/wiki_exemplar.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Wiki < ActiveRecord::Base - generator_for :start_page => 'Start' - generator_for :project, :method => :generate_project - - def self.generate_project - Project.generate! - end -end diff --git a/test/exemplars/wiki_page_exemplar.rb b/test/exemplars/wiki_page_exemplar.rb deleted file mode 100644 index 8db9a0e95..000000000 --- a/test/exemplars/wiki_page_exemplar.rb +++ /dev/null @@ -1,8 +0,0 @@ -class WikiPage < ActiveRecord::Base - generator_for :title, :start => 'AWikiPage' - generator_for :wiki, :method => :generate_wiki - - def self.generate_wiki - Wiki.generate! - end -end diff --git a/test/exemplars/wiki_redirect_exemplar.rb b/test/exemplars/wiki_redirect_exemplar.rb deleted file mode 100644 index cedb5bd00..000000000 --- a/test/exemplars/wiki_redirect_exemplar.rb +++ /dev/null @@ -1,9 +0,0 @@ -class WikiRedirect < ActiveRecord::Base - generator_for :title, :start => 'AWikiPage' - generator_for :redirects_to, :start => '/a/path/000001' - generator_for :wiki, :method => :generate_wiki - - def self.generate_wiki - Wiki.generate! - end -end diff --git a/test/object_daddy_helpers.rb b/test/object_helpers.rb similarity index 99% rename from test/object_daddy_helpers.rb rename to test/object_helpers.rb index 9a5c797d7..3cd5e5cd6 100644 --- a/test/object_daddy_helpers.rb +++ b/test/object_helpers.rb @@ -1,4 +1,4 @@ -module ObjectDaddyHelpers +module ObjectHelpers # TODO: Remove these three once everyone has ported their code to use the # new object_daddy version with protected attribute support def User.generate_with_protected(attributes={}) diff --git a/test/test_helper.rb b/test/test_helper.rb index 075acc5dd..759aaf438 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -20,8 +20,8 @@ require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' require Rails.root.join('test', 'mocks', 'open_id_authentication_mock.rb').to_s -require File.expand_path(File.dirname(__FILE__) + '/object_daddy_helpers') -include ObjectDaddyHelpers +require File.expand_path(File.dirname(__FILE__) + '/object_helpers') +include ObjectHelpers class ActiveSupport::TestCase # Transactional fixtures accelerate your tests by wrapping each test method