[#4184] Convert FixedDeliverable#total.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user