adapt to changed move_to_project implementation

pull/6827/head
Jens Ulferts 9 years ago
parent 7d2898eb3d
commit 73930b9aa0
  1. 8
      spec/models/work_package_spec.rb

@ -35,13 +35,15 @@ describe WorkPackage, :type => :model do
let!(:cost_entry) { FactoryGirl.create(:cost_entry, work_package: work_package, project: project, units: 3, spent_on: Date.today, user: user, comments: "test entry") }
let!(:cost_object) { FactoryGirl.create(:cost_object, project: project) }
before(:each) do
allow(User).to receive(:current).and_return(user)
def move_to_project(work_package, project)
service = MoveWorkPackageService.new(work_package, user)
service.call(project)
end
it "should update cost entries on move" do
expect(work_package.project_id).to eql project.id
expect(work_package.move_to_project(project2)).not_to be_falsey
expect(move_to_project(work_package, project2)).not_to be_falsey
expect(cost_entry.reload.project_id).to eql project2.id
end

Loading…
Cancel
Save