[#4184] Convert FixedDeliverable#total.
This commit is contained in:
1 parent
a7d61d6e36
commit
acf6e5e9b4
2 files changed
+16
No files matched your search
@@ -36,6 +36,13 @@ module RedmineContracts
|
|||||||
deliverable.contract = contract
|
deliverable.contract = contract
|
||||||
deliverable.manager = project.users.first
|
deliverable.manager = project.users.first
|
||||||
|
|
||||||
|
case old_deliverable['type']
|
||||||
|
when 'FixedDeliverable'
|
||||||
|
deliverable.total = old_deliverable['fixed_cost']
|
||||||
|
else
|
||||||
|
# no-op
|
||||||
|
end
|
||||||
|
|
||||||
deliverable.save!
|
deliverable.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -58,6 +58,15 @@ class BudgetPluginMigrationTest < ActionController::IntegrationTest
|
|||||||
|
|
||||||
assert_equal [@manager, @manager, @manager], Deliverable.all.collect(&:manager)
|
assert_equal [@manager, @manager, @manager], Deliverable.all.collect(&:manager)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
Reference in new issue
Block a user