diff --git a/spec/app/services/create_work_package_service_spec.rb b/spec/app/services/create_work_package_service_spec.rb index ed8cd27da0..8d76b90138 100644 --- a/spec/app/services/create_work_package_service_spec.rb +++ b/spec/app/services/create_work_package_service_spec.rb @@ -31,8 +31,10 @@ require 'spec_helper' describe CreateWorkPackageService do let(:user) { FactoryGirl.build(:user) } let(:work_package) { FactoryGirl.build(:work_package) } - let(:project) do - double('project', add_work_package: work_package) + let(:project) { FactoryGirl.build(:project_with_types) } + + before do + allow(project).to receive(:add_work_package).and_return(work_package) end subject(:service) { CreateWorkPackageService.new(user: user, project: project) }