get the object from the db anew, in case it didn't save

This commit is contained in:
Tim Felgentreff 2010-09-14 15:19:26 +02:00
parent 4eb07d6ce6
commit ccc4688799
1 changed files with 2 additions and 2 deletions

View File

@ -157,14 +157,14 @@ class ActiveSupport::TestCase
@detail = IssueJournal.generate(:version => 1, :journaled => Issue.last) @detail = IssueJournal.generate(:version => 1, :journaled => Issue.last)
@detail.update_attribute(:changes, {prop_key => [@old_value.id, @new_value.id]}.to_yaml) @detail.update_attribute(:changes, {prop_key => [@old_value.id, @new_value.id]}.to_yaml)
assert_match @new_value.name, @detail.render_detail(prop_key, true) assert_match @new_value.class.find(@new_value.id).name, @detail.render_detail(prop_key, true)
end end
should "use the old value's name" do should "use the old value's name" do
@detail = IssueJournal.generate(:version => 1, :journaled => Issue.last) @detail = IssueJournal.generate(:version => 1, :journaled => Issue.last)
@detail.update_attribute(:changes, {prop_key => [@old_value.id, @new_value.id]}.to_yaml) @detail.update_attribute(:changes, {prop_key => [@old_value.id, @new_value.id]}.to_yaml)
assert_match @old_value.name, @detail.render_detail(prop_key, true) assert_match @old_value.class.find(@old_value.id).name, @detail.render_detail(prop_key, true)
end end
end end
end end