diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-17 11:10:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-17 11:10:17 +0000 |
commit | c17ec1643c005036870b45c7b496bbbb3a9784be (patch) | |
tree | d9a195a5ad11249a25ee8d41e26ba611313e57e4 /test/functional | |
parent | dbf1fed6fbd5d572688c92fd014b96ec21864c63 (diff) | |
download | redmine-c17ec1643c005036870b45c7b496bbbb3a9784be.tar.gz redmine-c17ec1643c005036870b45c7b496bbbb3a9784be.zip |
Fixed that messages are not sorted by last reply (#12243).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11424 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/boards_controller_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/boards_controller_test.rb b/test/functional/boards_controller_test.rb index 1d82356e7..910f16e9a 100644 --- a/test/functional/boards_controller_test.rb +++ b/test/functional/boards_controller_test.rb @@ -69,6 +69,21 @@ class BoardsControllerTest < ActionController::TestCase assert topics.first.updated_on < topics.second.updated_on end + def test_show_should_display_message_with_last_reply_first + Message.update_all(:sticky => 0) + + # Reply to an old topic + old_topic = Message.where(:board_id => 1, :parent_id => nil).order('created_on ASC').first + reply = Message.new(:board_id => 1, :subject => 'New reply', :content => 'New reply', :author_id => 2) + old_topic.children << reply + + get :show, :project_id => 1, :id => 1 + assert_response :success + topics = assigns(:topics) + assert_not_nil topics + assert_equal old_topic, topics.first + end + def test_show_with_permission_should_display_the_new_message_form @request.session[:user_id] = 2 get :show, :project_id => 1, :id => 1 |