[#4184] Append the YAML object dump to the notes.

This commit is contained in:
Eric Davis
2010-07-14 10:37:32 -07:00
parent e6ab8ac3ab
commit 7d9f45d2ed
2 changed files with 12 additions and 1 deletions
@@ -1,3 +1,5 @@
require 'pp'
module RedmineContracts
# TODO: decide how this is activated.
@@ -63,7 +65,7 @@ module RedmineContracts
end
deliverable.notes += "Converted data:\n<pre>" + old_deliverable.pretty_inspect + "</pre>"
deliverable.save!
end
@@ -90,6 +90,14 @@ class BudgetPluginMigrationTest < ActionController::IntegrationTest
end
should "append the YAML dump of the old object to the notes" do
RedmineContracts::BudgetPluginMigration.migrate(@data)
d = Deliverable.find_by_title("Deliverable One")
assert_match /Converted data/, d.notes
assert_match /"profit"=>200.0/, d.notes
end
context "converting Fixed Deliverables" do
should "convert fixed_cost to total" do
RedmineContracts::BudgetPluginMigration.migrate(@data)
@@ -125,6 +133,7 @@ class BudgetPluginMigrationTest < ActionController::IntegrationTest
end
end
end
end