[#4183] Implemented FixedDeliverable#total_spent

This commit is contained in:
Eric Davis
2010-07-13 17:49:50 -07:00
parent 5d09a035c5
commit de42a32121
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -15,6 +15,11 @@ class FixedDeliverable < Deliverable
read_attribute(:total) || 0.0
end
# Fixed deliverables are always 100% spent
def total_spent
total
end
# The amount of profit that is budgeted for this deliverable.
# Profit = Total - ( Labor + Overhead + Fixed + Markup )
def profit_budget
+6
View File
@@ -21,4 +21,10 @@ class FixedDeliverableTest < ActiveSupport::TestCase
assert_equal 0, FixedDeliverable.generate(:total => nil).profit_budget
end
end
context "#total_spent" do
should "equal the budgeted total" do
assert_equal 1000, FixedDeliverable.generate(:total => 1_000).total_spent
end
end
end