Defect #7613 ยป object_daddy_exemplars.patch
| test/exemplars/issue_status_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class IssueStatus < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 | |
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'Status 0' |
|
| 6 |
@last_name.succ! |
|
| 7 |
@last_name |
|
| 4 |
def self.next_name(last_name) |
|
| 5 |
last_name ||= 'Status 0' |
|
| 6 |
last_name.succ |
|
| 8 | 7 |
end |
| 9 | 8 |
end |
| test/exemplars/document_category_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
generator_for :type => 'DocumentCategory' |
| 4 | 4 | |
| 5 |
def self.next_name |
|
| 6 |
@last_name ||= 'DocumentCategory0' |
|
| 7 |
@last_name.succ! |
|
| 8 |
@last_name |
|
| 5 |
def self.next_name(last_name) |
|
| 6 |
last_name ||= 'DocumentCategory0' |
|
| 7 |
last_name.succ |
|
| 9 | 8 |
end |
| 10 | 9 |
end |
| test/exemplars/change_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :path, :method => :next_path |
| 4 | 4 |
generator_for :changeset, :method => :generate_changeset |
| 5 | 5 | |
| 6 |
def self.next_path |
|
| 7 |
@last_path ||= 'test/dir/aaa0001' |
|
| 8 |
@last_path.succ! |
|
| 9 |
@last_path |
|
| 6 |
def self.next_path(last_path) |
|
| 7 |
last_path ||= 'test/dir/aaa0001' |
|
| 8 |
last_path.succ |
|
| 10 | 9 |
end |
| 11 | 10 | |
| 12 | 11 |
def self.generate_changeset |
| test/exemplars/message_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :content, :method => :next_content |
| 4 | 4 |
generator_for :board, :method => :generate_board |
| 5 | 5 | |
| 6 |
def self.next_subject |
|
| 7 |
@last_subject ||= 'A Message' |
|
| 8 |
@last_subject.succ! |
|
| 9 |
@last_subject |
|
| 6 |
def self.next_subject(last_subject) |
|
| 7 |
last_subject ||= 'A Message' |
|
| 8 |
last_subject.succ |
|
| 10 | 9 |
end |
| 11 | 10 | |
| 12 |
def self.next_content |
|
| 13 |
@last_content ||= 'Some content here' |
|
| 14 |
@last_content.succ! |
|
| 15 |
@last_content |
|
| 11 |
def self.next_content(last_content) |
|
| 12 |
last_content ||= 'Some content here' |
|
| 13 |
last_content.succ |
|
| 16 | 14 |
end |
| 17 | 15 | |
| 18 | 16 |
def self.generate_board |
| test/exemplars/custom_field_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
generator_for :field_format => 'string' |
| 4 | 4 | |
| 5 |
def self.next_name |
|
| 6 |
@last_name ||= 'CustomField0' |
|
| 7 |
@last_name.succ! |
|
| 8 |
@last_name |
|
| 5 |
def self.next_name(last_name) |
|
| 6 |
last_name ||= 'CustomField0' |
|
| 7 |
last_name.succ |
|
| 9 | 8 |
end |
| 10 | 9 |
end |
| test/exemplars/role_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class Role < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 | |
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'Role0'
|
|
| 6 |
@last_name.succ!
|
|
| 4 |
def self.next_name(last_name)
|
|
| 5 |
last_name ||= 'Role0' |
|
| 6 |
last_name.succ
|
|
| 7 | 7 |
end |
| 8 | 8 |
end |
| test/exemplars/issue_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :author, :method => :next_author |
| 4 | 4 |
generator_for :priority, :method => :fetch_priority |
| 5 | 5 |
|
| 6 |
def self.next_subject |
|
| 7 |
@last_subject ||= 'Subject 0' |
|
| 8 |
@last_subject.succ! |
|
| 9 |
@last_subject |
|
| 6 |
def self.next_subject(last_subject) |
|
| 7 |
last_subject ||= 'Subject 0' |
|
| 8 |
last_subject.succ |
|
| 10 | 9 |
end |
| 11 | 10 | |
| 12 | 11 |
def self.next_author |
| test/exemplars/project_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :identifier, :method => :next_identifier_from_object_daddy |
| 4 | 4 |
generator_for :enabled_modules, :method => :all_modules |
| 5 | 5 |
generator_for :trackers, :method => :next_tracker |
| 6 |
|
|
| 7 |
def self.next_name |
|
| 8 |
@last_name ||= 'Project 0' |
|
| 9 |
@last_name.succ! |
|
| 10 |
@last_name |
|
| 6 | ||
| 7 |
def self.next_name(last_name) |
|
| 8 |
last_name ||= 'Project 0' |
|
| 9 |
last_name.succ |
|
| 11 | 10 |
end |
| 12 | 11 | |
| 13 | 12 |
# Project#next_identifier is defined on Redmine |
| 14 |
def self.next_identifier_from_object_daddy |
|
| 15 |
@last_identifier ||= 'project-0000' |
|
| 16 |
@last_identifier.succ! |
|
| 17 |
@last_identifier |
|
| 13 |
def self.next_identifier_from_object_daddy(last_identifier) |
|
| 14 |
last_identifier ||= 'project-0000' |
|
| 15 |
last_identifier.succ |
|
| 18 | 16 |
end |
| 19 | 17 | |
| 20 | 18 |
def self.all_modules |
| test/exemplars/issue_priority_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
generator_for :type => 'IssuePriority' |
| 4 | 4 | |
| 5 |
def self.next_name |
|
| 6 |
@last_name ||= 'IssuePriority0' |
|
| 7 |
@last_name.succ! |
|
| 8 |
@last_name |
|
| 5 |
def self.next_name(last_name) |
|
| 6 |
last_name ||= 'IssuePriority0' |
|
| 7 |
last_name.succ |
|
| 9 | 8 |
end |
| 10 | 9 |
end |
| test/exemplars/document_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class Document < ActiveRecord::Base |
| 2 | 2 |
generator_for :title, :method => :next_title |
| 3 | 3 | |
| 4 |
def self.next_title |
|
| 5 |
@last_title ||= 'Document001' |
|
| 6 |
@last_title.succ! |
|
| 7 |
@last_title |
|
| 4 |
def self.next_title(last_title) |
|
| 5 |
last_title ||= 'Document001' |
|
| 6 |
last_title.succ |
|
| 8 | 7 |
end |
| 9 | 8 |
end |
| test/exemplars/repository_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :type => 'Subversion' |
| 3 | 3 |
generator_for :url, :method => :next_url |
| 4 | 4 | |
| 5 |
def self.next_url |
|
| 6 |
@last_url ||= 'file:///test/svn' |
|
| 7 |
@last_url.succ! |
|
| 8 |
@last_url |
|
| 5 |
def self.next_url(last_url) |
|
| 6 |
last_url ||= 'file:///test/svn' |
|
| 7 |
last_url.succ |
|
| 9 | 8 |
end |
| 10 | 9 | |
| 11 | 10 |
end |
| test/exemplars/board_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :description, :method => :next_description |
| 4 | 4 |
generator_for :project, :method => :generate_project |
| 5 | 5 | |
| 6 |
def self.next_name |
|
| 7 |
@last_name ||= 'A Forum' |
|
| 8 |
@last_name.succ! |
|
| 9 |
@last_name |
|
| 6 |
def self.next_name(last_name) |
|
| 7 |
last_name ||= 'A Forum' |
|
| 8 |
last_name.succ |
|
| 10 | 9 |
end |
| 11 | 10 | |
| 12 |
def self.next_description |
|
| 13 |
@last_description ||= 'Some description here' |
|
| 14 |
@last_description.succ! |
|
| 15 |
@last_description |
|
| 11 |
def self.next_description(last_description) |
|
| 12 |
last_description ||= 'Some description here' |
|
| 13 |
last_description.succ |
|
| 16 | 14 |
end |
| 17 | 15 | |
| 18 | 16 |
def self.generate_project |
| test/exemplars/user_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :mail, :method => :next_email |
| 4 | 4 |
generator_for :firstname, :method => :next_firstname |
| 5 | 5 |
generator_for :lastname, :method => :next_lastname |
| 6 |
|
|
| 7 |
def self.next_login |
|
| 8 |
@gen_login ||= 'user1' |
|
| 9 |
@gen_login.succ! |
|
| 10 |
@gen_login |
|
| 6 | ||
| 7 |
def self.next_login(gen_login) |
|
| 8 |
gen_login ||= 'user1' |
|
| 9 |
gen_login.succ |
|
| 11 | 10 |
end |
| 12 |
|
|
| 11 | ||
| 13 | 12 |
def self.next_email |
| 14 | 13 |
@last_email ||= 'user1' |
| 15 | 14 |
@last_email.succ! |
| 16 | 15 |
"#{@last_email}@example.com"
|
| 17 | 16 |
end |
| 18 | 17 | |
| 19 |
def self.next_firstname |
|
| 20 |
@last_firstname ||= 'Bob' |
|
| 21 |
@last_firstname.succ! |
|
| 22 |
@last_firstname |
|
| 18 |
def self.next_firstname(last_firstname) |
|
| 19 |
last_firstname ||= 'Bob' |
|
| 20 |
last_firstname.succ |
|
| 23 | 21 |
end |
| 24 | 22 | |
| 25 |
def self.next_lastname |
|
| 26 |
@last_lastname ||= 'Doe' |
|
| 27 |
@last_lastname.succ! |
|
| 28 |
@last_lastname |
|
| 23 |
def self.next_lastname(last_lastname) |
|
| 24 |
last_lastname ||= 'Doe' |
|
| 25 |
last_lastname.succ |
|
| 29 | 26 |
end |
| 30 | 27 |
end |
| test/exemplars/auth_source_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class AuthSource < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 | |
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'Auth0' |
|
| 6 |
@last_name.succ! |
|
| 7 |
@last_name |
|
| 4 |
def self.next_name(last_name) |
|
| 5 |
last_name ||= 'Auth0' |
|
| 6 |
last_name.succ |
|
| 8 | 7 |
end |
| 9 | 8 |
end |
| test/exemplars/enabled_module_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class EnabledModule < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 | |
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'module_001' |
|
| 6 |
@last_name.succ! |
|
| 7 |
@last_name |
|
| 4 |
def self.next_name(last_name) |
|
| 5 |
last_name ||= 'module_001' |
|
| 6 |
last_name.succ |
|
| 8 | 7 |
end |
| 9 | 8 | |
| 10 | 9 |
end |
| test/exemplars/tracker_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class Tracker < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 | |
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'Tracker 0' |
|
| 6 |
@last_name.succ! |
|
| 7 |
@last_name |
|
| 4 |
def self.next_name(last_name) |
|
| 5 |
last_name ||= 'Tracker 0' |
|
| 6 |
last_name.succ |
|
| 8 | 7 |
end |
| 9 | 8 |
end |
| test/exemplars/enumeration_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
generator_for :type => 'TimeEntryActivity' |
| 4 | 4 | |
| 5 |
def self.next_name |
|
| 6 |
@last_name ||= 'Enumeration0' |
|
| 7 |
@last_name.succ! |
|
| 8 |
@last_name |
|
| 5 |
def self.next_name(last_name) |
|
| 6 |
last_name ||= 'Enumeration0' |
|
| 7 |
last_name.succ |
|
| 9 | 8 |
end |
| 10 | 9 |
end |
| test/exemplars/group_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class Group < Principal |
| 2 | 2 |
generator_for :lastname, :method => :next_lastname |
| 3 | 3 | |
| 4 |
def self.next_lastname |
|
| 5 |
@last_lastname ||= 'Group' |
|
| 6 |
@last_lastname.succ! |
|
| 7 |
@last_lastname |
|
| 4 |
def self.next_lastname(last_lastname) |
|
| 5 |
last_lastname ||= 'Group' |
|
| 6 |
last_lastname.succ |
|
| 8 | 7 |
end |
| 9 | 8 | |
| 10 | 9 |
end |
| test/exemplars/time_entry_activity.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
generator_for :type => 'TimeEntryActivity' |
| 4 | 4 | |
| 5 |
def self.next_name |
|
| 6 |
@last_name ||= 'TimeEntryActivity0' |
|
| 7 |
@last_name.succ! |
|
| 8 |
@last_name |
|
| 5 |
def self.next_name(last_name) |
|
| 6 |
last_name ||= 'TimeEntryActivity0' |
|
| 7 |
last_name.succ |
|
| 9 | 8 |
end |
| 10 | 9 |
end |
| test/exemplars/wiki_redirect_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :redirects_to, :method => :next_redirects_to |
| 4 | 4 |
generator_for :wiki, :method => :generate_wiki |
| 5 | 5 | |
| 6 |
def self.next_title |
|
| 7 |
@last_title ||= 'AWikiPage' |
|
| 8 |
@last_title.succ! |
|
| 9 |
@last_title |
|
| 6 |
def self.next_title(last_title) |
|
| 7 |
last_title ||= 'AWikiPage' |
|
| 8 |
last_title.succ |
|
| 10 | 9 |
end |
| 11 | 10 | |
| 12 |
def self.next_redirects_to |
|
| 13 |
@last_redirect ||= '/a/path/000001' |
|
| 14 |
@last_redirect.succ! |
|
| 15 |
@last_redirect |
|
| 11 |
def self.next_redirects_to(last_redirect) |
|
| 12 |
last_redirect ||= '/a/path/000001' |
|
| 13 |
last_redirect.succ |
|
| 16 | 14 |
end |
| 17 | 15 | |
| 18 | 16 |
def self.generate_wiki |
| test/exemplars/query_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class Query < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 | |
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'Query 0' |
|
| 6 |
@last_name.succ! |
|
| 7 |
@last_name |
|
| 4 |
def self.next_name(last_name) |
|
| 5 |
last_name ||= 'Query 0' |
|
| 6 |
last_name.succ |
|
| 8 | 7 |
end |
| 9 | 8 |
end |
| test/exemplars/subversion_repository_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :type, :method => 'Subversion' |
| 3 | 3 |
generator_for :url, :method => :next_url |
| 4 | 4 | |
| 5 |
def self.next_url |
|
| 6 |
@last_url ||= 'file:///test/svn' |
|
| 7 |
@last_url.succ! |
|
| 8 |
@last_url |
|
| 5 |
def self.next_url(last_url) |
|
| 6 |
last_url ||= 'file:///test/svn' |
|
| 7 |
last_url.succ |
|
| 9 | 8 |
end |
| 10 | 9 | |
| 11 | 10 |
end |
| test/exemplars/issue_category_exemplar.rb (working copy) | ||
|---|---|---|
| 1 | 1 |
class IssueCategory < ActiveRecord::Base |
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
|
| 4 |
def self.next_name |
|
| 5 |
@last_name ||= 'Category 0001' |
|
| 6 |
@last_name.succ! |
|
| 7 |
@last_name |
|
| 4 |
def self.next_name(last_name) |
|
| 5 |
last_name ||= 'Category 0001' |
|
| 6 |
last_name.succ |
|
| 8 | 7 |
end |
| 9 | 8 |
end |
| test/exemplars/version_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :name, :method => :next_name |
| 3 | 3 |
generator_for :status => 'open' |
| 4 | 4 |
|
| 5 |
def self.next_name |
|
| 6 |
@last_name ||= 'Version 1.0.0' |
|
| 7 |
@last_name.succ! |
|
| 8 |
@last_name |
|
| 5 |
def self.next_name(last_name) |
|
| 6 |
last_name ||= 'Version 1.0.0' |
|
| 7 |
last_name.succ |
|
| 9 | 8 |
end |
| 10 | 9 |
|
| 11 | 10 |
end |
| test/exemplars/wiki_page_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :title, :method => :next_title |
| 3 | 3 |
generator_for :wiki, :method => :generate_wiki |
| 4 | 4 | |
| 5 |
def self.next_title |
|
| 6 |
@last_title ||= 'AWikiPage' |
|
| 7 |
@last_title.succ! |
|
| 8 |
@last_title |
|
| 5 |
def self.next_title(last_title) |
|
| 6 |
last_title ||= 'AWikiPage' |
|
| 7 |
last_title.succ |
|
| 9 | 8 |
end |
| 10 | 9 | |
| 11 | 10 |
def self.generate_wiki |
| test/exemplars/changeset_exemplar.rb (working copy) | ||
|---|---|---|
| 3 | 3 |
generator_for :committed_on => Date.today |
| 4 | 4 |
generator_for :repository, :method => :generate_repository |
| 5 | 5 | |
| 6 |
def self.next_revision |
|
| 7 |
@last_revision ||= '1' |
|
| 8 |
@last_revision.succ! |
|
| 9 |
@last_revision |
|
| 6 |
def self.next_revision(last_revision ) |
|
| 7 |
last_revision ||= '1' |
|
| 8 |
last_revision.succ |
|
| 10 | 9 |
end |
| 11 | 10 | |
| 12 | 11 |
def self.generate_repository |
| test/exemplars/news_exemplar.rb (working copy) | ||
|---|---|---|
| 2 | 2 |
generator_for :title, :method => :next_title |
| 3 | 3 |
generator_for :description, :method => :next_description |
| 4 | 4 | |
| 5 |
def self.next_title |
|
| 6 |
@last_title ||= 'A New Item' |
|
| 7 |
@last_title.succ! |
|
| 8 |
@last_title |
|
| 5 |
def self.next_title(last_title) |
|
| 6 |
last_title ||= 'A New Item' |
|
| 7 |
last_title.succ |
|
| 9 | 8 |
end |
| 10 | 9 | |
| 11 |
def self.next_description |
|
| 12 |
@last_description ||= 'Some content here' |
|
| 13 |
@last_description.succ! |
|
| 14 |
@last_description |
|
| 10 |
def self.next_description(last_description) |
|
| 11 |
last_description ||= 'Some content here' |
|
| 12 |
last_description.succ |
|
| 15 | 13 |
end |
| 16 | 14 |
end |