Skip to content

Commit 6abfa0a

Browse files
feat: added test for partially updating a channel member
1 parent 0c95342 commit 6abfa0a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/channel_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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
341354
end

0 commit comments

Comments
 (0)