##// END OF EJS Templates
remove trailing white-spaces from test/functional/messages_controller_test.rb....
Toshi MARUYAMA -
r6473:4d26ac31d650
parent child
Show More
@@ -1,16 +1,16
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 #
8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 #
13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -23,14 +23,14 class MessagesController; def rescue_action(e) raise e end; end
23 23
24 24 class MessagesControllerTest < ActionController::TestCase
25 25 fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules
26
26
27 27 def setup
28 28 @controller = MessagesController.new
29 29 @request = ActionController::TestRequest.new
30 30 @response = ActionController::TestResponse.new
31 31 User.current = nil
32 32 end
33
33
34 34 def test_show
35 35 get :show, :board_id => 1, :id => 1
36 36 assert_response :success
@@ -39,11 +39,11 class MessagesControllerTest < ActionController::TestCase
39 39 assert_not_nil assigns(:project)
40 40 assert_not_nil assigns(:topic)
41 41 end
42
42
43 43 def test_show_with_pagination
44 44 message = Message.find(1)
45 45 assert_difference 'Message.count', 30 do
46 30.times do
46 30.times do
47 47 message.children << Message.new(:subject => 'Reply', :content => 'Reply body', :author_id => 2, :board_id => 1)
48 48 end
49 49 end
@@ -55,7 +55,7 class MessagesControllerTest < ActionController::TestCase
55 55 assert !replies.include?(message.children.first(:order => 'id'))
56 56 assert replies.include?(message.children.last(:order => 'id'))
57 57 end
58
58
59 59 def test_show_with_reply_permission
60 60 @request.session[:user_id] = 2
61 61 get :show, :board_id => 1, :id => 1
@@ -64,24 +64,24 class MessagesControllerTest < ActionController::TestCase
64 64 assert_tag :div, :attributes => { :id => 'reply' },
65 65 :descendant => { :tag => 'textarea', :attributes => { :id => 'message_content' } }
66 66 end
67
67
68 68 def test_show_message_not_found
69 69 get :show, :board_id => 1, :id => 99999
70 70 assert_response 404
71 71 end
72
72
73 73 def test_get_new
74 74 @request.session[:user_id] = 2
75 75 get :new, :board_id => 1
76 76 assert_response :success
77 assert_template 'new'
77 assert_template 'new'
78 78 end
79
79
80 80 def test_post_new
81 81 @request.session[:user_id] = 2
82 82 ActionMailer::Base.deliveries.clear
83 83 Setting.notified_events = ['message_posted']
84
84
85 85 post :new, :board_id => 1,
86 86 :message => { :subject => 'Test created message',
87 87 :content => 'Message body'}
@@ -101,14 +101,14 class MessagesControllerTest < ActionController::TestCase
101 101 # project member
102 102 assert mail.bcc.include?('dlopper@somenet.foo')
103 103 end
104
104
105 105 def test_get_edit
106 106 @request.session[:user_id] = 2
107 107 get :edit, :board_id => 1, :id => 1
108 108 assert_response :success
109 assert_template 'edit'
109 assert_template 'edit'
110 110 end
111
111
112 112 def test_post_edit
113 113 @request.session[:user_id] = 2
114 114 post :edit, :board_id => 1, :id => 1,
@@ -119,7 +119,7 class MessagesControllerTest < ActionController::TestCase
119 119 assert_equal 'New subject', message.subject
120 120 assert_equal 'New body', message.content
121 121 end
122
122
123 123 def test_reply
124 124 @request.session[:user_id] = 2
125 125 post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
@@ -127,14 +127,14 class MessagesControllerTest < ActionController::TestCase
127 127 assert_redirected_to "/boards/1/topics/1?r=#{reply.id}"
128 128 assert Message.find_by_subject('Test reply')
129 129 end
130
130
131 131 def test_destroy_topic
132 132 @request.session[:user_id] = 2
133 133 post :destroy, :board_id => 1, :id => 1
134 134 assert_redirected_to '/projects/ecookbook/boards/1'
135 135 assert_nil Message.find_by_id(1)
136 136 end
137
137
138 138 def test_quote
139 139 @request.session[:user_id] = 2
140 140 xhr :get, :quote, :board_id => 1, :id => 3
General Comments 0
You need to be logged in to leave comments. Login now