Calc cleanup

This commit is contained in:
Eric Davis
2008-06-03 17:19:30 -07:00
parent 5180b5b218
commit 490bf73efe
8 changed files with 45 additions and 1 deletions
+12
View File
@@ -186,6 +186,18 @@ describe Budget, '.progress' do
@budget = Budget.new(@project.id)
@budget.progress.should eql(100)
end
it 'should return 100 if there is no budget' do
@deliverable1 = mock_model(Deliverable, :project_id => @project, :budget => 0.00, :progress => 50)
@deliverable2 = mock_model(Deliverable, :project_id => @project, :budget => 0.00, :progress => 75)
@project = mock_model(Project)
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
Project.stub!(:find).with(@project.id).and_return(@project)
@budget = Budget.new(@project.id)
@budget.progress.should eql(100)
end
end
describe Budget,'.budget' do