Added a test to cover Budget#labor_budget_left. #1924

This commit is contained in:
Eric Davis
2009-01-21 15:47:31 -08:00
parent 1706412bb8
commit 11b8a0a462

View File

@@ -325,6 +325,19 @@ describe Budget, '.left' do
end
end
describe Budget, '.labor_budget_left' do
it 'should be calculated by the labor budget and total spent of the deliverables' do
@project = mock_model(Project)
Project.stub!(:find).with(@project.id).and_return(@project)
@budget = Budget.new(@project.id)
@budget.should_receive(:labor_budget).and_return(6000.0)
@budget.should_receive(:spent).and_return(4500.0)
@budget.labor_budget_left.should eql(1500.0)
end
end
describe Budget, '.overruns' do
it 'should be 0 if there is still unspent budget' do
@project = mock_model(Project)