[#4183] Implemented HourlyDeliverable#total_spent.

This commit is contained in:
Eric Davis
2010-07-13 18:11:02 -07:00
parent 597062fdf8
commit cd3ba5e5e5
2 changed files with 36 additions and 0 deletions
+20
View File
@@ -29,6 +29,26 @@ class HourlyDeliverableTest < ActiveSupport::TestCase
assert_equal 100.0 * 10, d.total
end
end
context "#total_spent" do
should "be equal to the number of hours used multipled by the contract rate" do
configure_overhead_plugin
contract = Contract.generate!(:billable_rate => 150.0)
@project = Project.generate!
@developer = User.generate!
@role = Role.generate!
User.add_to_project(@developer, @project, @role)
d = HourlyDeliverable.generate!(:contract => contract)
d.issues << @issue1 = Issue.generate_for_project!(@project)
TimeEntry.generate!(:hours => 15, :issue => @issue1, :project => @project,
:activity => @billable_activity,
:user => @developer)
assert_equal 2250, d.total_spent
end
end
context "#total=" do
should "not write any attributes" do