Merge pull request #458 from opf/feature/work_package_renamings

Replace deprecated generate_for_project with Factory Girl, remove :issue...
pull/464/head
sschu 11 years ago
commit 8d98f3eb28
  1. 6
      features/step_definitions/general_steps.rb
  2. 2
      spec/factories/time_entry_factory.rb
  3. 2
      test/exemplars/journal_exemplar.rb

@ -181,7 +181,7 @@ Given /^the [Uu]ser "([^\"]*)" has 1 time [eE]ntry$/ do |user|
u = User.find_by_login user
p = u.projects.last
raise "This user must be member of a project to have issues" unless p
i = WorkPackage.generate_for_project!(p)
i = FactoryGirl.create(:work_package, project: p)
t = TimeEntry.generate
t.user = u
t.issue = i
@ -195,7 +195,7 @@ Given /^the [Uu]ser "([^\"]*)" has 1 time entry with (\d+\.?\d*) hours? at the p
p = Project.find_by_name(project) || Project.find_by_identifier(project)
as_admin do
t = TimeEntry.generate
i = WorkPackage.generate_for_project!(p)
i = FactoryGirl.create(:work_package, project: p)
t.project = p
t.issue = i
t.hours = hours.to_f
@ -211,7 +211,7 @@ Given /^the [Pp]roject "([^\"]*)" has (\d+) [tT]ime(?: )?[eE]ntr(?:ies|y) with t
p = Project.find_by_name(project) || Project.find_by_identifier(project)
as_admin count do
t = TimeEntry.generate
i = WorkPackage.generate_for_project!(p)
i = FactoryGirl.create(:work_package, project: p)
t.project = p
t.work_package = i
t.activity.project = p

@ -30,7 +30,7 @@ FactoryGirl.define do
factory :time_entry do
project
user
work_package :factory => :issue
work_package
spent_on Date.today
activity :factory => :time_entry_activity
hours 1.0

@ -33,7 +33,7 @@ class Journal < ActiveRecord::Base
def self.generate_issue
project = Project.generate!
WorkPackage.generate_for_project!(project)
FactoryGirl.create(:work_package, project: project)
end
def self.generate_user

Loading…
Cancel
Save