diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-14 20:53:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-14 20:53:14 +0000 |
commit | 46756cbd5646286a96df9058373324454add49a4 (patch) | |
tree | 971e3dbe40cbd7db875a416d7e524e7f45bbb71b /test/functional | |
parent | 48205aa7d98275c8effbc21750449cb2461b0e57 (diff) | |
download | redmine-46756cbd5646286a96df9058373324454add49a4.tar.gz redmine-46756cbd5646286a96df9058373324454add49a4.zip |
Fixed 500 error when displaying a news with comments in reverse order (#18332).
git-svn-id: http://svn.redmine.org/redmine/trunk@13595 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/news_controller_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index 8a7586285..7d342605f 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -63,6 +63,17 @@ class NewsControllerTest < ActionController::TestCase assert_tag 'a', :content => attachment.filename end + def test_show_with_comments_in_reverse_order + user = User.find(1) + user.pref[:comments_sorting] = 'desc' + user.pref.save! + + @request.session[:user_id] = 1 + get :show, :id => 1 + assert_response :success + assert_equal News.find(1).comments.to_a.sort_by(&:created_on).reverse, assigns(:comments) + end + def test_show_not_found get :show, :id => 999 assert_response 404 |