comparison test/functional/messages_controller_test.rb @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +0100
parents cbb26bc654de
children 433d4f72a19b
comparison
equal deleted inserted replaced
909:cbb26bc654de 929:5f33065ddc4b
129 message = Message.find(1) 129 message = Message.find(1)
130 assert_equal 'New subject', message.subject 130 assert_equal 'New subject', message.subject
131 assert_equal 'New body', message.content 131 assert_equal 'New body', message.content
132 end 132 end
133 133
134 def test_post_edit_sticky_and_locked
135 @request.session[:user_id] = 2
136 post :edit, :board_id => 1, :id => 1,
137 :message => { :subject => 'New subject',
138 :content => 'New body',
139 :locked => '1',
140 :sticky => '1'}
141 assert_redirected_to '/boards/1/topics/1'
142 message = Message.find(1)
143 assert_equal true, message.sticky?
144 assert_equal true, message.locked?
145 end
146
147 def test_post_edit_should_allow_to_change_board
148 @request.session[:user_id] = 2
149 post :edit, :board_id => 1, :id => 1,
150 :message => { :subject => 'New subject',
151 :content => 'New body',
152 :board_id => 2}
153 assert_redirected_to '/boards/2/topics/1'
154 message = Message.find(1)
155 assert_equal Board.find(2), message.board
156 end
157
134 def test_reply 158 def test_reply
135 @request.session[:user_id] = 2 159 @request.session[:user_id] = 2
136 post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' } 160 post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
137 reply = Message.find(:first, :order => 'id DESC') 161 reply = Message.find(:first, :order => 'id DESC')
138 assert_redirected_to "/boards/1/topics/1?r=#{reply.id}" 162 assert_redirected_to "/boards/1/topics/1?r=#{reply.id}"