diff 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
line wrap: on
line diff
--- a/test/functional/messages_controller_test.rb	Fri Feb 24 19:09:32 2012 +0000
+++ b/test/functional/messages_controller_test.rb	Wed Jun 27 14:54:18 2012 +0100
@@ -131,6 +131,30 @@
     assert_equal 'New body', message.content
   end
 
+  def test_post_edit_sticky_and_locked
+    @request.session[:user_id] = 2
+    post :edit, :board_id => 1, :id => 1,
+                :message => { :subject => 'New subject',
+                              :content => 'New body',
+                              :locked => '1',
+                              :sticky => '1'}
+    assert_redirected_to '/boards/1/topics/1'
+    message = Message.find(1)
+    assert_equal true, message.sticky?
+    assert_equal true, message.locked?
+  end
+
+  def test_post_edit_should_allow_to_change_board
+    @request.session[:user_id] = 2
+    post :edit, :board_id => 1, :id => 1,
+                :message => { :subject => 'New subject',
+                              :content => 'New body',
+                              :board_id => 2}
+    assert_redirected_to '/boards/2/topics/1'
+    message = Message.find(1)
+    assert_equal Board.find(2), message.board
+  end
+
   def test_reply
     @request.session[:user_id] = 2
     post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }