From 7d9f45d2ed91891c025cd9e5d4499a63208dffc7 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 14 Jul 2010 10:37:32 -0700 Subject: [PATCH] [#4184] Append the YAML object dump to the notes. --- lib/redmine_contracts/budget_plugin_migration.rb | 4 +++- test/integration/budget_plugin_migration_test.rb | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/redmine_contracts/budget_plugin_migration.rb b/lib/redmine_contracts/budget_plugin_migration.rb index b54713b..108ff20 100644 --- a/lib/redmine_contracts/budget_plugin_migration.rb +++ b/lib/redmine_contracts/budget_plugin_migration.rb @@ -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
" + old_deliverable.pretty_inspect + "
" deliverable.save! end diff --git a/test/integration/budget_plugin_migration_test.rb b/test/integration/budget_plugin_migration_test.rb index c2e30bd..53b153a 100644 --- a/test/integration/budget_plugin_migration_test.rb +++ b/test/integration/budget_plugin_migration_test.rb @@ -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