Skip to content

Commit d6738d8

Browse files
committed
added tests for the thread_content action of comments controller
1 parent 7212378 commit d6738d8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'test_helper'
2+
require 'comments_test_helpers'
3+
4+
class CommentsControllerTest < ActionController::TestCase
5+
include Devise::Test::ControllerHelpers
6+
include CommentsControllerTestHelpers
7+
8+
test 'should correctly get thread content' do
9+
normal_two = comment_threads(:normal_two)
10+
11+
try_thread_content(normal_two)
12+
13+
assert_response(:success)
14+
assert_not_nil assigns(:comment_thread)
15+
assert_equal normal_two.updated_at, response.get_header('Last-Modified')
16+
end
17+
18+
private
19+
20+
def try_thread_content(thread)
21+
get :thread_content, params: { id: thread.id }
22+
end
23+
end

0 commit comments

Comments
 (0)