File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class Moderation
1515 {
1616 user : 'stream:user' ,
1717 message : 'stream:chat:v1:message' ,
18- userprofile : 'stream:v1:user_profile' ,
18+ userprofile : 'stream:v1:user_profile'
1919 } . freeze ,
2020 T ::Hash [ Symbol , String ]
2121 )
@@ -38,6 +38,9 @@ def initialize(client)
3838 # @option profile [String] :username Username to be checked
3939 # @option profile [String] :image Image URL to be checked
4040 # @return [StreamChat::StreamResponse]
41+ #
42+ # example:
43+ # client.moderation.check_user_profile('user-id', {username: 'bad_username', image: 'https://example.com/profile.jpg'})
4144 sig do
4245 params (
4346 user_id : String ,
Original file line number Diff line number Diff line change @@ -159,6 +159,24 @@ def loop_times(times)
159159 expect ( response [ 'duration' ] ) . not_to be_nil
160160 end
161161
162+ it 'check user profile' do
163+ response = @moderation . check_user_profile (
164+ @test_user_id ,
165+ { username : 'fuck_you_123' }
166+ )
167+ expect ( response [ 'duration' ] ) . not_to be_nil
168+ expect ( response [ 'status' ] ) . to eq ( 'complete' )
169+ expect ( response [ 'recommended_action' ] ) . to eq ( 'remove' )
170+
171+ response = @moderation . check_user_profile (
172+ @test_user_id ,
173+ { username : 'hi' }
174+ )
175+ expect ( response [ 'duration' ] ) . not_to be_nil
176+ expect ( response [ 'status' ] ) . to eq ( 'complete' )
177+ expect ( response [ 'recommended_action' ] ) . to eq ( 'keep' )
178+ end
179+
162180 it 'config test' do
163181 # Create moderation config
164182 moderation_config = {
You can’t perform that action at this time.
0 commit comments