Skip to content

Commit

Permalink
Merge #464
Browse files Browse the repository at this point in the history
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 <>
  • Loading branch information
meili-bors[bot] authored Aug 14, 2023
2 parents 3dbbf29 + b9dc5d7 commit 40f4f71
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/meilisearch/client/tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
tasks = index.tasks

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

last_task = tasks['results'].first

Expand All @@ -36,6 +37,7 @@
tasks = client.tasks

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

last_task = tasks['results'].first

Expand All @@ -48,16 +50,19 @@
expect(tasks['results'].count).to be <= 2
expect(tasks['from']).to be_a(Integer)
expect(tasks['next']).to be_a(Integer)
expect(tasks['total']).to be > 0
end

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

expect(tasks['results'].count).to eq(0)
expect(tasks['total']).to eq(0)

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

expect(tasks['results'].count).to be > 1
expect(tasks['total']).to be > 1
end

it 'ensures supports to all available filters' do
Expand Down

0 comments on commit 40f4f71

Please sign in to comment.