[#6574] Associate LaborBudgets with TimeEntryActivities

This commit is contained in:
Eric Davis
2011-09-14 18:39:49 -07:00
parent 38c22e2f92
commit df61a1fe9e
10 changed files with 34 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ class DeliverablesEditTest < ActionController::IntegrationTest
@hourly_deliverable = HourlyDeliverable.generate!(:contract => @contract, :manager => @manager, :title => 'An Hourly')
@user = User.generate_user_with_permission_to_manage_budget(:project => @project)
configure_overhead_plugin
login_as(@user.login, 'contracts')
end

View File

@@ -7,6 +7,7 @@ class DeliverablesNewTest < ActionController::IntegrationTest
@project = Project.generate!(:identifier => 'main')
@contract = Contract.generate!(:project => @project)
@user = User.generate_user_with_permission_to_manage_budget(:project => @project)
configure_overhead_plugin
login_as(@user.login, 'contracts')
end
@@ -231,6 +232,7 @@ class DeliverablesNewTest < ActionController::IntegrationTest
end
within("#deliverable-labor") do
select @billable_activity.name, :from => 'Activity'
fill_in "hrs", :with => '20'
fill_in "$", :with => '$2,000'
end
@@ -258,6 +260,7 @@ class DeliverablesNewTest < ActionController::IntegrationTest
@labor_budget = @deliverable.labor_budgets.first
assert_equal 20, @labor_budget.hours
assert_equal 2000.0, @labor_budget.budget
assert_equal @billable_activity, @labor_budget.time_entry_activity
assert_equal 1, @deliverable.overhead_budgets.count
@overhead_budget = @deliverable.overhead_budgets.first

View File

@@ -2,6 +2,9 @@ require File.dirname(__FILE__) + '/../test_helper'
class LaborBudgetTest < ActiveSupport::TestCase
should_belong_to :deliverable
should_belong_to :time_entry_activity
should_validate_presence_of :time_entry_activity_id
context "#budget=" do
should "strip dollar signs when writing" do