From 897a6e2aa265e70bb407a944e2c65972fad3be63 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 7 Jul 2010 12:50:48 -0700 Subject: [PATCH] [#4182] Testing and fixing patches from the Overhead plugin to Deliverables. --- app/models/fixed_deliverable.rb | 7 +++ .../overhead_plugin_integration_test.rb | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 test/integration/overhead_plugin_integration_test.rb diff --git a/app/models/fixed_deliverable.rb b/app/models/fixed_deliverable.rb index 708bdc4..8d56a25 100644 --- a/app/models/fixed_deliverable.rb +++ b/app/models/fixed_deliverable.rb @@ -10,4 +10,11 @@ class FixedDeliverable < Deliverable def short_type 'F' end + + # Hardcoded value used as a wrapper for the old Budget plugin API. + # + # The Overhead plugin uses this in it's calcuations. + def fixed_cost + 0 + end end diff --git a/test/integration/overhead_plugin_integration_test.rb b/test/integration/overhead_plugin_integration_test.rb new file mode 100644 index 0000000..16c4469 --- /dev/null +++ b/test/integration/overhead_plugin_integration_test.rb @@ -0,0 +1,43 @@ +require 'test_helper' + +class OverheadPluginIntegrationTest < ActionController::IntegrationTest + def setup + @project = Project.generate!(:identifier => 'main') + @contract = Contract.generate!(:project => @project, :name => 'A Contract', :payment_terms => 'net_15') + @manager = User.generate! + @role = Role.generate! + User.add_to_project(@manager, @project, @role) + @fixed_deliverable = FixedDeliverable.generate!(:contract => @contract, :manager => @manager, :title => 'The Title') + @hourly_deliverable = HourlyDeliverable.generate!(:contract => @contract, :manager => @manager, :title => 'An Hourly') + end + + context "Patches to Deliverable" do + context "#overhead_spent" do + should "return the total cost for all of the time on the issues for non-billable activities" + end + end + + context "Patches to HourlyDeliverable" do + context "#labor_budget_spent" do + should "return 0 if there are no issues assigned" do + assert_equal 0, @hourly_deliverable.issues.count + + assert_equal 0, @hourly_deliverable.labor_budget_spent + end + + should "return the total cost for all of the time on the issues for billable activities" + end + end + + context "Patches to FixedDeliverable" do + context "#labor_budget_spent" do + should "return 0 if there are no issues assigned" do + assert_equal 0, @fixed_deliverable.issues.count + + assert_equal 0, @fixed_deliverable.labor_budget_spent + end + should "return the total cost for all of the time on the issues for billable activities" + end + end + +end