We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 295e8e6 commit 6de8a85Copy full SHA for 6de8a85
1 file changed
test/controllers/comments/rename_test.rb
@@ -23,7 +23,6 @@ class CommentsControllerTest < ActionController::TestCase
23
before_title = comment_threads(name).title
24
25
try_rename_thread(comment_threads(name))
26
-
27
@thread = assigns(:comment_thread)
28
29
assert_response(:found)
@@ -32,4 +31,18 @@ class CommentsControllerTest < ActionController::TestCase
32
31
assert_equal before_title, @thread.title
33
end
34
+
35
+ test 'should correctly handle invalid thread titles' do
36
+ sign_in users(:admin)
37
38
+ ['', 'a' * 512].each do |title|
39
+ try_rename_thread(comment_threads(:normal), title: title)
40
+ @thread = assigns(:comment_thread)
41
42
+ assert_response(:found)
43
+ assert_not_nil @thread
44
+ assert_not @thread.valid?
45
+ assert_not_nil flash[:danger]
46
+ end
47
48
0 commit comments