don't define exemplars twice

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1527 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
t.felgentreff 14 years ago
parent 5aa1865a30
commit 1a1fea910b
  1. 18
      test/exemplars/cost_entry_exemplar.rb
  2. 2
      test/exemplars/cost_object_exemplar.rb
  3. 8
      test/exemplars/cost_rate_exemplar.rb

@ -14,24 +14,24 @@ CostEntry.class_eval do
generator_for :tyear, 2010
generator_for :tmonth, 3
generator_for :tweek, 10
def self.next_project
Project.last or Project.generate!
Project.last || Project.generate!
end
def self.next_cost_rate
CostRate.last or CostRate.generate!
CostRate.last || CostRate.generate!
end
def self.next_user
User.find_by_login("admin")
User.generate_with_protected!
end
def self.next_cost_type
CostType.last or CostType.generate!
CostType.last || CostType.generate!
end
def self.next_issue
self.next_project.issues.last or Issue.generate_for_project!(next_project)
self.next_project.issues.last || Issue.generate_for_project!(next_project)
end
end

@ -10,6 +10,6 @@ CostObject.class_eval do
end
def self.next_author
User.find_by_name("admin")
User.first
end
end

@ -1,12 +1,12 @@
CostRate.class_eval do
Rate.class_eval do
generator_for :valid_from, :method => :next_valid_from
generator_for :rate, 10
generator_for :cost_type, :method => :next_cost_type
def self.next_cost_type
CostType.last or CostType.generate!
CostType.last || CostType.generate!
end
def self.next_valid_from
1.year.ago + Rate.count
end

Loading…
Cancel
Save