File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,3 +68,9 @@ new_user_on_own_post:
6868 reply_count : 0
6969 post : new_user_question
7070 community : sample
71+
72+ with_user_pings :
73+ title : Pings for @#-1 and @#<%= ActiveRecord::FixtureSet.identify :standard_user %> users
74+ reply_count : 1
75+ post : question_one
76+ community : sample
Original file line number Diff line number Diff line change @@ -70,3 +70,14 @@ new_user_on_own_post:
7070 comment_thread : new_user_on_own_post
7171 created_at : 2020-01-01T00:00:00.000000Z
7272 updated_at : 2021-01-01T00:00:00.000000Z
73+
74+ with_user_pings :
75+ user : standard_user
76+ post : question_one
77+ content : >
78+ special ping for @#-1 user (system)
79+ and for @#<%= ActiveRecord::FixtureSet.identify :standard_user % > (user)
80+ community : sample
81+ comment_thread : with_user_pings
82+ created_at : 2020-01-01T00:00:00.000000Z
83+ updated_at : 2021-01-01T00:00:00.000000Z
Original file line number Diff line number Diff line change @@ -33,4 +33,14 @@ class CommentTest < ActiveSupport::TestCase
3333 assert_not Comment ::USER_PING_REG_EXP . match? ( mention )
3434 end
3535 end
36+
37+ test 'pings should correctly' do
38+ std_user = users ( :standard_user )
39+ with_pings = comments ( :with_user_pings )
40+
41+ pings = with_pings . pings
42+
43+ assert pings . include? ( std_user . id )
44+ assert_not pings . include? ( User . system . id )
45+ end
3646end
You can’t perform that action at this time.
0 commit comments