Skip to content

Commit 6dca17a

Browse files
feat: Improve QueryReminders tests to verify filter results actually match criteria
1 parent 709a852 commit 6dca17a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

spec/client_spec.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,9 +1342,25 @@ def loop_times(times)
13421342
expect(response['reminders']).to be_an(Array)
13431343
expect(response['reminders'].length).to be >= 1
13441344

1345-
# All reminders should have a channel_cid
1345+
# All reminders should have a channel_cid that matches the filter
13461346
response['reminders'].each do |reminder|
13471347
expect(reminder).to include('channel_cid')
1348+
expect(reminder['channel_cid']).to eq(@channel.cid)
1349+
end
1350+
end
1351+
1352+
it 'query reminders with message_id filter' do
1353+
# Query reminders for a specific message
1354+
filter = { 'message_id' => @message_id }
1355+
response = @client.query_reminders(@user_id, filter)
1356+
1357+
expect(response).to include('reminders')
1358+
expect(response['reminders']).to be_an(Array)
1359+
expect(response['reminders'].length).to be >= 1
1360+
1361+
# All reminders should have the filtered message_id
1362+
response['reminders'].each do |reminder|
1363+
expect(reminder['message_id']).to eq(@message_id)
13481364
end
13491365
end
13501366
end

0 commit comments

Comments
 (0)