[#4673] Add an option to remove the converted data from deliverables

This commit is contained in:
Eric Davis
2010-10-21 09:50:46 -07:00
parent 1fafe8ea92
commit a302c17b04
3 changed files with 24 additions and 7 deletions
@@ -174,12 +174,23 @@ 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")
context "YAML dumping of the old object to notes" do
should "be appended by default" 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
should "be have an option to be turned off" do
RedmineContracts::BudgetPluginMigration.migrate(@data, :append_object_notes => false)
d = Deliverable.find_by_title("Deliverable One")
assert_equal nil, d.notes.match(/Converted data/)
assert_equal nil, d.notes.match(/"profit"=>200.0/)
end
assert_match /Converted data/, d.notes
assert_match /"profit"=>200.0/, d.notes
end
context "converting Fixed Deliverables" do