[#4184] Convert FixedDeliverable#total.

This commit is contained in:
Eric Davis
2010-07-14 10:05:36 -07:00
parent a7d61d6e36
commit acf6e5e9b4
2 changed files with 16 additions and 0 deletions
@@ -36,6 +36,13 @@ module RedmineContracts
deliverable.contract = contract
deliverable.manager = project.users.first
case old_deliverable['type']
when 'FixedDeliverable'
deliverable.total = old_deliverable['fixed_cost']
else
# no-op
end
deliverable.save!
end
end
@@ -58,6 +58,15 @@ class BudgetPluginMigrationTest < ActionController::IntegrationTest
assert_equal [@manager, @manager, @manager], Deliverable.all.collect(&:manager)
end
context "converting Fixed Deliverables" do
should "convert fixed_cost to total" do
RedmineContracts::BudgetPluginMigration.migrate(@data)
d = FixedDeliverable.find_by_title("Version 1.0")
assert_equal 30_000, d.total
end
end
end
end