File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11require 'test_helper'
22
33class CommentsHelperTest < ActionView ::TestCase
4+ include ApplicationHelper
5+ include UsersHelper
46 include Devise ::Test ::ControllerHelpers
57
68 test '[help center] and [help] substitution' do
@@ -108,4 +110,20 @@ class CommentsHelperTest < ActionView::TestCase
108110 assert_nil limit_message
109111 end
110112 end
113+
114+ test 'render_pings should correctly render comment pings' do
115+ std = users ( :standard_user )
116+ mod = users ( :moderator )
117+
118+ sign_in std
119+
120+ host = RequestContext . community . host
121+
122+ rendered = render_pings ( "this is not correct, @##{ std . id } . @##{ mod . id } 's answer is better. @#123, thoughs?" ,
123+ host : host )
124+
125+ assert Regexp . new ( "http:\\ /\\ /#{ Regexp . escape ( host ) } \\ /users\\ /#{ std . id } " ) . match? ( rendered )
126+ assert Regexp . new ( "http:\\ /\\ /#{ Regexp . escape ( host ) } \\ /users\\ /#{ mod . id } " ) . match? ( rendered )
127+ assert ( /@#123/ . match? ( rendered ) )
128+ end
111129end
You can’t perform that action at this time.
0 commit comments