##// END OF EJS Templates
Merged r11446 from trunk (#13232)....
Jean-Philippe Lang -
r11366:c2eb28b9015c
parent child
Show More
@@ -1,139 +1,140
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class MessagesController < ApplicationController
18 class MessagesController < ApplicationController
19 menu_item :boards
19 menu_item :boards
20 default_search_scope :messages
20 default_search_scope :messages
21 before_filter :find_board, :only => [:new, :preview]
21 before_filter :find_board, :only => [:new, :preview]
22 before_filter :find_message, :except => [:new, :preview]
22 before_filter :find_message, :except => [:new, :preview]
23 before_filter :authorize, :except => [:preview, :edit, :destroy]
23 before_filter :authorize, :except => [:preview, :edit, :destroy]
24
24
25 helper :boards
25 helper :boards
26 helper :watchers
26 helper :watchers
27 helper :attachments
27 helper :attachments
28 include AttachmentsHelper
28 include AttachmentsHelper
29
29
30 REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE)
30 REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE)
31
31
32 # Show a topic and its replies
32 # Show a topic and its replies
33 def show
33 def show
34 page = params[:page]
34 page = params[:page]
35 # Find the page of the requested reply
35 # Find the page of the requested reply
36 if params[:r] && page.nil?
36 if params[:r] && page.nil?
37 offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
37 offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
38 page = 1 + offset / REPLIES_PER_PAGE
38 page = 1 + offset / REPLIES_PER_PAGE
39 end
39 end
40
40
41 @reply_count = @topic.children.count
41 @reply_count = @topic.children.count
42 @reply_pages = Paginator.new self, @reply_count, REPLIES_PER_PAGE, page
42 @reply_pages = Paginator.new self, @reply_count, REPLIES_PER_PAGE, page
43 @replies = @topic.children.find(:all, :include => [:author, :attachments, {:board => :project}],
43 @replies = @topic.children.find(:all, :include => [:author, :attachments, {:board => :project}],
44 :order => "#{Message.table_name}.created_on ASC",
44 :order => "#{Message.table_name}.created_on ASC",
45 :limit => @reply_pages.items_per_page,
45 :limit => @reply_pages.items_per_page,
46 :offset => @reply_pages.current.offset)
46 :offset => @reply_pages.current.offset)
47
47
48 @reply = Message.new(:subject => "RE: #{@message.subject}")
48 @reply = Message.new(:subject => "RE: #{@message.subject}")
49 render :action => "show", :layout => false if request.xhr?
49 render :action => "show", :layout => false if request.xhr?
50 end
50 end
51
51
52 # Create a new topic
52 # Create a new topic
53 def new
53 def new
54 @message = Message.new
54 @message = Message.new
55 @message.author = User.current
55 @message.author = User.current
56 @message.board = @board
56 @message.board = @board
57 @message.safe_attributes = params[:message]
57 @message.safe_attributes = params[:message]
58 if request.post?
58 if request.post?
59 @message.save_attachments(params[:attachments])
59 @message.save_attachments(params[:attachments])
60 if @message.save
60 if @message.save
61 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
61 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
62 render_attachment_warning_if_needed(@message)
62 render_attachment_warning_if_needed(@message)
63 redirect_to board_message_path(@board, @message)
63 redirect_to board_message_path(@board, @message)
64 end
64 end
65 end
65 end
66 end
66 end
67
67
68 # Reply to a topic
68 # Reply to a topic
69 def reply
69 def reply
70 @reply = Message.new
70 @reply = Message.new
71 @reply.author = User.current
71 @reply.author = User.current
72 @reply.board = @board
72 @reply.board = @board
73 @reply.safe_attributes = params[:reply]
73 @reply.safe_attributes = params[:reply]
74 @topic.children << @reply
74 @topic.children << @reply
75 if !@reply.new_record?
75 if !@reply.new_record?
76 call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
76 call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
77 attachments = Attachment.attach_files(@reply, params[:attachments])
77 attachments = Attachment.attach_files(@reply, params[:attachments])
78 render_attachment_warning_if_needed(@reply)
78 render_attachment_warning_if_needed(@reply)
79 end
79 end
80 redirect_to board_message_path(@board, @topic, :r => @reply)
80 redirect_to board_message_path(@board, @topic, :r => @reply)
81 end
81 end
82
82
83 # Edit a message
83 # Edit a message
84 def edit
84 def edit
85 (render_403; return false) unless @message.editable_by?(User.current)
85 (render_403; return false) unless @message.editable_by?(User.current)
86 @message.safe_attributes = params[:message]
86 @message.safe_attributes = params[:message]
87 if request.post? && @message.save
87 if request.post? && @message.save
88 attachments = Attachment.attach_files(@message, params[:attachments])
88 attachments = Attachment.attach_files(@message, params[:attachments])
89 render_attachment_warning_if_needed(@message)
89 render_attachment_warning_if_needed(@message)
90 flash[:notice] = l(:notice_successful_update)
90 flash[:notice] = l(:notice_successful_update)
91 @message.reload
91 @message.reload
92 redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id))
92 redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id))
93 end
93 end
94 end
94 end
95
95
96 # Delete a messages
96 # Delete a messages
97 def destroy
97 def destroy
98 (render_403; return false) unless @message.destroyable_by?(User.current)
98 (render_403; return false) unless @message.destroyable_by?(User.current)
99 r = @message.to_param
99 r = @message.to_param
100 @message.destroy
100 @message.destroy
101 if @message.parent
101 if @message.parent
102 redirect_to board_message_path(@board, @message.parent, :r => r)
102 redirect_to board_message_path(@board, @message.parent, :r => r)
103 else
103 else
104 redirect_to project_board_path(@project, @board)
104 redirect_to project_board_path(@project, @board)
105 end
105 end
106 end
106 end
107
107
108 def quote
108 def quote
109 @subject = @message.subject
109 @subject = @message.subject
110 @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
110 @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
111
111
112 @content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
112 @content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
113 @content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
113 @content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
114 end
114 end
115
115
116 def preview
116 def preview
117 message = @board.messages.find_by_id(params[:id])
117 message = @board.messages.find_by_id(params[:id])
118 @attachements = message.attachments if message
118 @attachements = message.attachments if message
119 @text = (params[:message] || params[:reply])[:content]
119 @text = (params[:message] || params[:reply])[:content]
120 @previewed = message
120 @previewed = message
121 render :partial => 'common/preview'
121 render :partial => 'common/preview'
122 end
122 end
123
123
124 private
124 private
125 def find_message
125 def find_message
126 find_board
126 return unless find_board
127 @message = @board.messages.find(params[:id], :include => :parent)
127 @message = @board.messages.find(params[:id], :include => :parent)
128 @topic = @message.root
128 @topic = @message.root
129 rescue ActiveRecord::RecordNotFound
129 rescue ActiveRecord::RecordNotFound
130 render_404
130 render_404
131 end
131 end
132
132
133 def find_board
133 def find_board
134 @board = Board.find(params[:board_id], :include => :project)
134 @board = Board.find(params[:board_id], :include => :project)
135 @project = @board.project
135 @project = @board.project
136 rescue ActiveRecord::RecordNotFound
136 rescue ActiveRecord::RecordNotFound
137 render_404
137 render_404
138 nil
138 end
139 end
139 end
140 end
@@ -1,213 +1,218
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19 require 'messages_controller'
19 require 'messages_controller'
20
20
21 # Re-raise errors caught by the controller.
21 # Re-raise errors caught by the controller.
22 class MessagesController; def rescue_action(e) raise e end; end
22 class MessagesController; def rescue_action(e) raise e end; end
23
23
24 class MessagesControllerTest < ActionController::TestCase
24 class MessagesControllerTest < ActionController::TestCase
25 fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules
25 fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules
26
26
27 def setup
27 def setup
28 @controller = MessagesController.new
28 @controller = MessagesController.new
29 @request = ActionController::TestRequest.new
29 @request = ActionController::TestRequest.new
30 @response = ActionController::TestResponse.new
30 @response = ActionController::TestResponse.new
31 User.current = nil
31 User.current = nil
32 end
32 end
33
33
34 def test_show
34 def test_show
35 get :show, :board_id => 1, :id => 1
35 get :show, :board_id => 1, :id => 1
36 assert_response :success
36 assert_response :success
37 assert_template 'show'
37 assert_template 'show'
38 assert_not_nil assigns(:board)
38 assert_not_nil assigns(:board)
39 assert_not_nil assigns(:project)
39 assert_not_nil assigns(:project)
40 assert_not_nil assigns(:topic)
40 assert_not_nil assigns(:topic)
41 end
41 end
42
42
43 def test_show_should_contain_reply_field_tags_for_quoting
43 def test_show_should_contain_reply_field_tags_for_quoting
44 @request.session[:user_id] = 2
44 @request.session[:user_id] = 2
45 get :show, :board_id => 1, :id => 1
45 get :show, :board_id => 1, :id => 1
46 assert_response :success
46 assert_response :success
47
47
48 # tags required by MessagesController#quote
48 # tags required by MessagesController#quote
49 assert_tag 'input', :attributes => {:id => 'message_subject'}
49 assert_tag 'input', :attributes => {:id => 'message_subject'}
50 assert_tag 'textarea', :attributes => {:id => 'message_content'}
50 assert_tag 'textarea', :attributes => {:id => 'message_content'}
51 assert_tag 'div', :attributes => {:id => 'reply'}
51 assert_tag 'div', :attributes => {:id => 'reply'}
52 end
52 end
53
53
54 def test_show_with_pagination
54 def test_show_with_pagination
55 message = Message.find(1)
55 message = Message.find(1)
56 assert_difference 'Message.count', 30 do
56 assert_difference 'Message.count', 30 do
57 30.times do
57 30.times do
58 message.children << Message.new(:subject => 'Reply', :content => 'Reply body', :author_id => 2, :board_id => 1)
58 message.children << Message.new(:subject => 'Reply', :content => 'Reply body', :author_id => 2, :board_id => 1)
59 end
59 end
60 end
60 end
61 get :show, :board_id => 1, :id => 1, :r => message.children.last(:order => 'id').id
61 get :show, :board_id => 1, :id => 1, :r => message.children.last(:order => 'id').id
62 assert_response :success
62 assert_response :success
63 assert_template 'show'
63 assert_template 'show'
64 replies = assigns(:replies)
64 replies = assigns(:replies)
65 assert_not_nil replies
65 assert_not_nil replies
66 assert !replies.include?(message.children.first(:order => 'id'))
66 assert !replies.include?(message.children.first(:order => 'id'))
67 assert replies.include?(message.children.last(:order => 'id'))
67 assert replies.include?(message.children.last(:order => 'id'))
68 end
68 end
69
69
70 def test_show_with_reply_permission
70 def test_show_with_reply_permission
71 @request.session[:user_id] = 2
71 @request.session[:user_id] = 2
72 get :show, :board_id => 1, :id => 1
72 get :show, :board_id => 1, :id => 1
73 assert_response :success
73 assert_response :success
74 assert_template 'show'
74 assert_template 'show'
75 assert_tag :div, :attributes => { :id => 'reply' },
75 assert_tag :div, :attributes => { :id => 'reply' },
76 :descendant => { :tag => 'textarea', :attributes => { :id => 'message_content' } }
76 :descendant => { :tag => 'textarea', :attributes => { :id => 'message_content' } }
77 end
77 end
78
78
79 def test_show_message_not_found
79 def test_show_message_not_found
80 get :show, :board_id => 1, :id => 99999
80 get :show, :board_id => 1, :id => 99999
81 assert_response 404
81 assert_response 404
82 end
82 end
83
83
84 def test_show_message_from_invalid_board_should_respond_with_404
85 get :show, :board_id => 999, :id => 1
86 assert_response 404
87 end
88
84 def test_get_new
89 def test_get_new
85 @request.session[:user_id] = 2
90 @request.session[:user_id] = 2
86 get :new, :board_id => 1
91 get :new, :board_id => 1
87 assert_response :success
92 assert_response :success
88 assert_template 'new'
93 assert_template 'new'
89 end
94 end
90
95
91 def test_post_new
96 def test_post_new
92 @request.session[:user_id] = 2
97 @request.session[:user_id] = 2
93 ActionMailer::Base.deliveries.clear
98 ActionMailer::Base.deliveries.clear
94
99
95 with_settings :notified_events => %w(message_posted) do
100 with_settings :notified_events => %w(message_posted) do
96 post :new, :board_id => 1,
101 post :new, :board_id => 1,
97 :message => { :subject => 'Test created message',
102 :message => { :subject => 'Test created message',
98 :content => 'Message body'}
103 :content => 'Message body'}
99 end
104 end
100 message = Message.find_by_subject('Test created message')
105 message = Message.find_by_subject('Test created message')
101 assert_not_nil message
106 assert_not_nil message
102 assert_redirected_to "/boards/1/topics/#{message.to_param}"
107 assert_redirected_to "/boards/1/topics/#{message.to_param}"
103 assert_equal 'Message body', message.content
108 assert_equal 'Message body', message.content
104 assert_equal 2, message.author_id
109 assert_equal 2, message.author_id
105 assert_equal 1, message.board_id
110 assert_equal 1, message.board_id
106
111
107 mail = ActionMailer::Base.deliveries.last
112 mail = ActionMailer::Base.deliveries.last
108 assert_not_nil mail
113 assert_not_nil mail
109 assert_equal "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] Test created message", mail.subject
114 assert_equal "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] Test created message", mail.subject
110 assert_mail_body_match 'Message body', mail
115 assert_mail_body_match 'Message body', mail
111 # author
116 # author
112 assert mail.bcc.include?('jsmith@somenet.foo')
117 assert mail.bcc.include?('jsmith@somenet.foo')
113 # project member
118 # project member
114 assert mail.bcc.include?('dlopper@somenet.foo')
119 assert mail.bcc.include?('dlopper@somenet.foo')
115 end
120 end
116
121
117 def test_get_edit
122 def test_get_edit
118 @request.session[:user_id] = 2
123 @request.session[:user_id] = 2
119 get :edit, :board_id => 1, :id => 1
124 get :edit, :board_id => 1, :id => 1
120 assert_response :success
125 assert_response :success
121 assert_template 'edit'
126 assert_template 'edit'
122 end
127 end
123
128
124 def test_post_edit
129 def test_post_edit
125 @request.session[:user_id] = 2
130 @request.session[:user_id] = 2
126 post :edit, :board_id => 1, :id => 1,
131 post :edit, :board_id => 1, :id => 1,
127 :message => { :subject => 'New subject',
132 :message => { :subject => 'New subject',
128 :content => 'New body'}
133 :content => 'New body'}
129 assert_redirected_to '/boards/1/topics/1'
134 assert_redirected_to '/boards/1/topics/1'
130 message = Message.find(1)
135 message = Message.find(1)
131 assert_equal 'New subject', message.subject
136 assert_equal 'New subject', message.subject
132 assert_equal 'New body', message.content
137 assert_equal 'New body', message.content
133 end
138 end
134
139
135 def test_post_edit_sticky_and_locked
140 def test_post_edit_sticky_and_locked
136 @request.session[:user_id] = 2
141 @request.session[:user_id] = 2
137 post :edit, :board_id => 1, :id => 1,
142 post :edit, :board_id => 1, :id => 1,
138 :message => { :subject => 'New subject',
143 :message => { :subject => 'New subject',
139 :content => 'New body',
144 :content => 'New body',
140 :locked => '1',
145 :locked => '1',
141 :sticky => '1'}
146 :sticky => '1'}
142 assert_redirected_to '/boards/1/topics/1'
147 assert_redirected_to '/boards/1/topics/1'
143 message = Message.find(1)
148 message = Message.find(1)
144 assert_equal true, message.sticky?
149 assert_equal true, message.sticky?
145 assert_equal true, message.locked?
150 assert_equal true, message.locked?
146 end
151 end
147
152
148 def test_post_edit_should_allow_to_change_board
153 def test_post_edit_should_allow_to_change_board
149 @request.session[:user_id] = 2
154 @request.session[:user_id] = 2
150 post :edit, :board_id => 1, :id => 1,
155 post :edit, :board_id => 1, :id => 1,
151 :message => { :subject => 'New subject',
156 :message => { :subject => 'New subject',
152 :content => 'New body',
157 :content => 'New body',
153 :board_id => 2}
158 :board_id => 2}
154 assert_redirected_to '/boards/2/topics/1'
159 assert_redirected_to '/boards/2/topics/1'
155 message = Message.find(1)
160 message = Message.find(1)
156 assert_equal Board.find(2), message.board
161 assert_equal Board.find(2), message.board
157 end
162 end
158
163
159 def test_reply
164 def test_reply
160 @request.session[:user_id] = 2
165 @request.session[:user_id] = 2
161 post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
166 post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
162 reply = Message.find(:first, :order => 'id DESC')
167 reply = Message.find(:first, :order => 'id DESC')
163 assert_redirected_to "/boards/1/topics/1?r=#{reply.id}"
168 assert_redirected_to "/boards/1/topics/1?r=#{reply.id}"
164 assert Message.find_by_subject('Test reply')
169 assert Message.find_by_subject('Test reply')
165 end
170 end
166
171
167 def test_destroy_topic
172 def test_destroy_topic
168 @request.session[:user_id] = 2
173 @request.session[:user_id] = 2
169 assert_difference 'Message.count', -3 do
174 assert_difference 'Message.count', -3 do
170 post :destroy, :board_id => 1, :id => 1
175 post :destroy, :board_id => 1, :id => 1
171 end
176 end
172 assert_redirected_to '/projects/ecookbook/boards/1'
177 assert_redirected_to '/projects/ecookbook/boards/1'
173 assert_nil Message.find_by_id(1)
178 assert_nil Message.find_by_id(1)
174 end
179 end
175
180
176 def test_destroy_reply
181 def test_destroy_reply
177 @request.session[:user_id] = 2
182 @request.session[:user_id] = 2
178 assert_difference 'Message.count', -1 do
183 assert_difference 'Message.count', -1 do
179 post :destroy, :board_id => 1, :id => 2
184 post :destroy, :board_id => 1, :id => 2
180 end
185 end
181 assert_redirected_to '/boards/1/topics/1?r=2'
186 assert_redirected_to '/boards/1/topics/1?r=2'
182 assert_nil Message.find_by_id(2)
187 assert_nil Message.find_by_id(2)
183 end
188 end
184
189
185 def test_quote
190 def test_quote
186 @request.session[:user_id] = 2
191 @request.session[:user_id] = 2
187 xhr :get, :quote, :board_id => 1, :id => 3
192 xhr :get, :quote, :board_id => 1, :id => 3
188 assert_response :success
193 assert_response :success
189 assert_equal 'text/javascript', response.content_type
194 assert_equal 'text/javascript', response.content_type
190 assert_template 'quote'
195 assert_template 'quote'
191 assert_include 'RE: First post', response.body
196 assert_include 'RE: First post', response.body
192 assert_include '> An other reply', response.body
197 assert_include '> An other reply', response.body
193 end
198 end
194
199
195 def test_preview_new
200 def test_preview_new
196 @request.session[:user_id] = 2
201 @request.session[:user_id] = 2
197 post :preview,
202 post :preview,
198 :board_id => 1,
203 :board_id => 1,
199 :message => {:subject => "", :content => "Previewed text"}
204 :message => {:subject => "", :content => "Previewed text"}
200 assert_response :success
205 assert_response :success
201 assert_template 'common/_preview'
206 assert_template 'common/_preview'
202 end
207 end
203
208
204 def test_preview_edit
209 def test_preview_edit
205 @request.session[:user_id] = 2
210 @request.session[:user_id] = 2
206 post :preview,
211 post :preview,
207 :id => 4,
212 :id => 4,
208 :board_id => 1,
213 :board_id => 1,
209 :message => {:subject => "", :content => "Previewed text"}
214 :message => {:subject => "", :content => "Previewed text"}
210 assert_response :success
215 assert_response :success
211 assert_template 'common/_preview'
216 assert_template 'common/_preview'
212 end
217 end
213 end
218 end
General Comments 0
You need to be logged in to leave comments. Login now