Commit ccc46887 authored by Tim Felgentreff's avatar Tim Felgentreff

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

parent 4eb07d6c
...@@ -157,14 +157,14 @@ class ActiveSupport::TestCase ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment