Mercurial > hg > soundsoftware-site
comparison test/functional/boards_controller_test.rb @ 1294:3e4c3460b6ca redmine-2.2
Update to Redmine SVN revision 11972 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:01:12 +0100 |
parents | 433d4f72a19b |
children | 622f24f53b42 261b3d9a4903 |
comparison
equal
deleted
inserted
replaced
1115:433d4f72a19b | 1294:3e4c3460b6ca |
---|---|
67 assert topics.size > 1, "topics size was #{topics.size}" | 67 assert topics.size > 1, "topics size was #{topics.size}" |
68 assert topics.first.sticky? | 68 assert topics.first.sticky? |
69 assert topics.first.updated_on < topics.second.updated_on | 69 assert topics.first.updated_on < topics.second.updated_on |
70 end | 70 end |
71 | 71 |
72 def test_show_should_display_message_with_last_reply_first | |
73 Message.update_all(:sticky => 0) | |
74 | |
75 # Reply to an old topic | |
76 old_topic = Message.where(:board_id => 1, :parent_id => nil).order('created_on ASC').first | |
77 reply = Message.new(:board_id => 1, :subject => 'New reply', :content => 'New reply', :author_id => 2) | |
78 old_topic.children << reply | |
79 | |
80 get :show, :project_id => 1, :id => 1 | |
81 assert_response :success | |
82 topics = assigns(:topics) | |
83 assert_not_nil topics | |
84 assert_equal old_topic, topics.first | |
85 end | |
86 | |
72 def test_show_with_permission_should_display_the_new_message_form | 87 def test_show_with_permission_should_display_the_new_message_form |
73 @request.session[:user_id] = 2 | 88 @request.session[:user_id] = 2 |
74 get :show, :project_id => 1, :id => 1 | 89 get :show, :project_id => 1, :id => 1 |
75 assert_response :success | 90 assert_response :success |
76 assert_template 'show' | 91 assert_template 'show' |