Skip to content

Commit 59b54a6

Browse files
brunoocasalibidoubiwa
authored andcommitted
Fix tests after adding facetStats
1 parent a8d4ea6 commit 59b54a6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

spec/meilisearch/index/search/facets_distribution_spec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
response = index.search('prinec', facets: ['genre', 'author'])
1313
expect(response.keys).to contain_exactly(
1414
*DEFAULT_SEARCH_RESPONSE_KEYS,
15-
'facetDistribution'
15+
'facetDistribution',
16+
'facetStats'
1617
)
1718
expect(response['estimatedTotalHits']).to eq(2)
1819
expect(response['facetDistribution'].keys).to contain_exactly('genre', 'author')
@@ -27,7 +28,8 @@
2728
response = index.search('', facets: ['genre', 'author'])
2829
expect(response.keys).to contain_exactly(
2930
*DEFAULT_SEARCH_RESPONSE_KEYS,
30-
'facetDistribution'
31+
'facetDistribution',
32+
'facetStats'
3133
)
3234
expect(response['estimatedTotalHits']).to eq(documents.count)
3335
expect(response['facetDistribution'].keys).to contain_exactly('genre', 'author')
@@ -42,7 +44,8 @@
4244
response = index.search('', facets: ['year'])
4345
expect(response.keys).to contain_exactly(
4446
*DEFAULT_SEARCH_RESPONSE_KEYS,
45-
'facetDistribution'
47+
'facetDistribution',
48+
'facetStats'
4649
)
4750
expect(response['estimatedTotalHits']).to eq(documents.count)
4851
expect(response['facetDistribution'].keys).to contain_exactly('year')

spec/meilisearch/index/search/multi_params_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@
6666
response = index.update_filterable_attributes(['genre'])
6767
index.wait_for_task(response['taskUid'])
6868
response = index.search('prinec', facets: ['genre'], limit: 1)
69+
6970
expect(response.keys).to contain_exactly(
7071
*DEFAULT_SEARCH_RESPONSE_KEYS,
71-
'facetDistribution'
72+
'facetDistribution',
73+
'facetStats'
7274
)
7375
expect(response['estimatedTotalHits']).to eq(2)
7476
expect(response['hits'].count).to eq(1)

0 commit comments

Comments
 (0)