diff --git a/spec/channel_spec.rb b/spec/channel_spec.rb index fcf751d..68a2c27 100644 --- a/spec/channel_spec.rb +++ b/spec/channel_spec.rb @@ -375,73 +375,6 @@ def loop_times(times) expect(msg['message']['restricted_visibility']).to match_array([@random_users[0][:id], @random_users[1][:id]]) end - it 'can update message with restricted visibility' do - # Add users as members before testing restricted visibility - @channel.add_members([@random_users[0][:id], @random_users[1][:id]]) - - # First send a regular message - msg = @channel.send_message( - { - 'text' => 'original message' - }, - @random_user[:id] - ) - - # Update the message with restricted visibility - updated_msg = @client.update_message( - { - 'id' => msg['message']['id'], - 'text' => 'updated secret message', - 'restricted_visibility' => [@random_users[0][:id], @random_users[1][:id]], - 'user' => { 'id' => @random_user[:id] } - } - ) - - # Verify the message was updated successfully - expect(updated_msg).to include 'message' - expect(updated_msg['message']['text']).to eq 'updated secret message' - - # Verify the restricted visibility - expect(updated_msg['message']['restricted_visibility']).to match_array([@random_users[0][:id], @random_users[1][:id]]) - end - - it 'can update message partially with restricted visibility' do - # Add users as members before testing restricted visibility - @channel.add_members([@random_users[0][:id], @random_users[1][:id]]) - - # First send a regular message - msg = @channel.send_message( - { - 'text' => 'original message', - 'custom_field' => 'original value' - }, - @random_user[:id] - ) - - # Partially update the message with restricted visibility - updated_msg = @client.update_message_partial( - msg['message']['id'], - { - set: { - text: 'partially updated secret message', - restricted_visibility: [@random_users[0][:id], @random_users[1][:id]] - }, - unset: ['custom_field'] - }, - user_id: @random_user[:id] - ) - - # Verify the message was updated successfully - expect(updated_msg).to include 'message' - expect(updated_msg['message']['text']).to eq 'partially updated secret message' - - # Verify the restricted visibility was set - expect(updated_msg['message']['restricted_visibility']).to match_array([@random_users[0][:id], @random_users[1][:id]]) - - # Verify the custom field was unset - expect(updated_msg['message']).not_to include 'custom_field' - end - it 'can create draft message' do draft_message = { 'text' => 'This is a draft message' } response = @channel.create_draft(draft_message, @random_user[:id])