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. 10
      test/exemplars/cost_entry_exemplar.rb
  2. 2
      test/exemplars/cost_object_exemplar.rb
  3. 4
      test/exemplars/cost_rate_exemplar.rb

@ -16,22 +16,22 @@ CostEntry.class_eval do
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,10 +1,10 @@
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

Loading…
Cancel
Save