[#4184] Use a mapper to track primary key differences on Deliverables.

This commit is contained in:
Eric Davis
2010-07-19 10:39:40 -07:00
parent 279ed4c206
commit 06e3f8d39a
3 changed files with 32 additions and 1 deletions
@@ -172,6 +172,28 @@ class BudgetPluginMigrationTest < ActionController::IntegrationTest
end
end
context "converting issue ids" do
setup do
@issue1 = Issue.generate_for_project!(@project_two, :deliverable_id => 2)
@issue2 = Issue.generate_for_project!(@project_two, :deliverable_id => 4)
end
should "keep the same Deliverable assigned" do
RedmineContracts::BudgetPluginMigration.migrate(@data)
assert_equal "Deliverable 2", @issue1.reload.deliverable.title
assert_equal "Version 1.0", @issue2.reload.deliverable.title
end
should "handle primary key differences between the old and new Deliverables" do
RedmineContracts::BudgetPluginMigration.migrate(@data)
# The "third" deliverable has an id of 4
assert_equal "Version 1.0", @issue2.reload.deliverable.title
end
end
end
end