[#4181] Add a total field to deliverables.

This commit is contained in:
Eric Davis
2010-07-01 15:22:12 -07:00
parent 7efaf8dbe2
commit ae8c75a051
6 changed files with 47 additions and 1 deletions
+23
View File
@@ -7,4 +7,27 @@ class DeliverableTest < ActiveSupport::TestCase
should_validate_presence_of :title
should_validate_presence_of :type
should_validate_presence_of :manager
context "#total=" do
should "strip dollar signs when writing" do
d = Deliverable.new
d.total = '$100.00'
assert_equal 100.00, d.total.to_f
end
should "strip commas when writing" do
d = Deliverable.new
d.total = '20,100.00'
assert_equal 20100.00, d.total.to_f
end
should "strip spaces when writing" do
d = Deliverable.new
d.total = '20 100.00'
assert_equal 20100.00, d.total.to_f
end
end
end