diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-06-16 19:34:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-06-16 19:34:19 +0000 |
commit | 542b355210f901e9628127b8ae9a4de1787710f7 (patch) | |
tree | 236a7b5903ffe42be2e22846996f3692c68f86e9 /test/functional/boards_controller_test.rb | |
parent | 897e83a556374ee47a8b55bac21e40f323adbd96 (diff) | |
download | redmine-542b355210f901e9628127b8ae9a4de1787710f7.tar.gz redmine-542b355210f901e9628127b8ae9a4de1787710f7.zip |
Fixed that sticky messages are not displayed first (#11170).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9836 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/boards_controller_test.rb')
-rw-r--r-- | test/functional/boards_controller_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/boards_controller_test.rb b/test/functional/boards_controller_test.rb index 744177bd3..1c4ac67d4 100644 --- a/test/functional/boards_controller_test.rb +++ b/test/functional/boards_controller_test.rb @@ -55,6 +55,20 @@ class BoardsControllerTest < ActionController::TestCase assert_not_nil assigns(:topics) end + def test_show_should_display_sticky_messages_first + Message.update_all(:sticky => 0) + Message.update_all({:sticky => 1}, {:id => 1}) + + get :show, :project_id => 1, :id => 1 + assert_response :success + + topics = assigns(:topics) + assert_not_nil topics + assert topics.size > 1, "topics size was #{topics.size}" + assert topics.first.sticky? + assert topics.first.updated_on < topics.second.updated_on + end + def test_show_with_permission_should_display_the_new_message_form @request.session[:user_id] = 2 get :show, :project_id => 1, :id => 1 |