Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated generate_for_project with Factory Girl, remove :issue... #458

Merged
merged 1 commit into from
Sep 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions features/step_definitions/general_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
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
Expand All @@ -195,7 +195,7 @@
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
Expand All @@ -211,7 +211,7 @@
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
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/time_entry_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
factory :time_entry do
project
user
work_package :factory => :issue
work_package
spent_on Date.today
activity :factory => :time_entry_activity
hours 1.0
Expand Down
2 changes: 1 addition & 1 deletion test/exemplars/journal_exemplar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down