[#6441] Add a manual Contract#status

This commit is contained in:
Eric Davis
2011-08-08 11:48:35 -07:00
parent fbd38b3678
commit 9453b52c10
10 changed files with 136 additions and 19 deletions
+9
View File
@@ -17,6 +17,9 @@ class ContractTest < ActiveSupport::TestCase
should_allow_values_for :discount_type, "$", "%", nil, ''
should_not_allow_values_for :discount_type, ["amount", "percent", "bar"]
should_allow_values_for :status, "", nil, 'open', 'locked', 'closed'
should_not_allow_values_for :status, "other", "things", "1"
context "end_date" do
should "be after start_date" do
@contract = Contract.new(:start_date => Date.today, :end_date => Date.yesterday)
@@ -32,6 +35,12 @@ class ContractTest < ActiveSupport::TestCase
assert_equal false, @contract.executed
end
should "default status to open" do
@contract = Contract.new
assert_equal "open", @contract.status
end
context "#labor_budget" do
should "sum all of the labor budgets of the Deliverables" do
contract = Contract.generate!