Fixed that deleting the last reply of a topic does not update last_reply_id.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9939 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -133,6 +133,21 @@ class MessageTest < ActiveSupport::TestCase
|
||||
assert_equal messages_count - 1, board.messages_count
|
||||
end
|
||||
|
||||
def test_destroying_last_reply_should_update_topic_last_reply_id
|
||||
topic = Message.find(4)
|
||||
assert_equal 6, topic.last_reply_id
|
||||
|
||||
assert_difference 'Message.count', -1 do
|
||||
Message.find(6).destroy
|
||||
end
|
||||
assert_equal 5, topic.reload.last_reply_id
|
||||
|
||||
assert_difference 'Message.count', -1 do
|
||||
Message.find(5).destroy
|
||||
end
|
||||
assert_nil topic.reload.last_reply_id
|
||||
end
|
||||
|
||||
def test_editable_by
|
||||
message = Message.find(6)
|
||||
author = message.author
|
||||
|
||||
Reference in New Issue
Block a user