File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -338,4 +338,17 @@ def loop_times(times)
338338 expect ( response [ 'channels' ] . length ) . to eq 1
339339 expect ( response [ 'channels' ] [ 0 ] [ 'channel' ] [ 'cid' ] ) . to eq @channel . cid
340340 end
341+
342+ it 'can update channel member partially' do
343+ @channel . add_members ( [ @random_users [ 0 ] [ :id ] ] )
344+
345+ # Test setting a field
346+ response = @channel . update_member_partial ( @random_users [ 0 ] [ :id ] , set : { 'hat' => 'blue' } )
347+ expect ( response [ 'channel_member' ] [ 'hat' ] ) . to eq 'blue'
348+
349+ # Test setting and unsetting fields
350+ response = @channel . update_member_partial ( @random_users [ 0 ] [ :id ] , set : { 'color' => 'red' } , unset : [ 'hat' ] )
351+ expect ( response [ 'channel_member' ] [ 'color' ] ) . to eq 'red'
352+ expect ( response [ 'channel_member' ] ) . not_to have_key ( 'hat' )
353+ end
341354end
You can’t perform that action at this time.
0 commit comments