Skip to content

Commit 40f4f71

Browse files
Merge #464
464: [v1.3] Total Tasks in task route #463 r=brunoocasali a=andre-m-dev # Pull Request ## Related issue Fixes #463 ## What does this PR do? Ensures that the total field is included in the response ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Andre <>
2 parents 3dbbf29 + b9dc5d7 commit 40f4f71

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/meilisearch/client/tasks_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
tasks = index.tasks
1919

2020
expect(tasks['results']).to be_a(Array)
21+
expect(tasks['total']).to be > 0
2122

2223
last_task = tasks['results'].first
2324

@@ -36,6 +37,7 @@
3637
tasks = client.tasks
3738

3839
expect(tasks['results']).to be_a(Array)
40+
expect(tasks['total']).to be > 0
3941

4042
last_task = tasks['results'].first
4143

@@ -48,16 +50,19 @@
4850
expect(tasks['results'].count).to be <= 2
4951
expect(tasks['from']).to be_a(Integer)
5052
expect(tasks['next']).to be_a(Integer)
53+
expect(tasks['total']).to be > 0
5154
end
5255

5356
it 'filters tasks with index_uids/types/statuses' do
5457
tasks = client.tasks(index_uids: ['a-cool-index-name'])
5558

5659
expect(tasks['results'].count).to eq(0)
60+
expect(tasks['total']).to eq(0)
5761

5862
tasks = client.tasks(index_uids: ['books'], types: ['documentAdditionOrUpdate'], statuses: ['succeeded'])
5963

6064
expect(tasks['results'].count).to be > 1
65+
expect(tasks['total']).to be > 1
6166
end
6267

6368
it 'ensures supports to all available filters' do

0 commit comments

Comments
 (0)