-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to custom search with matching_strategy param
- Loading branch information
1 parent
f3af64e
commit db88115
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'MeiliSearch::Index - Search with matching_strategy' do | ||
include_context 'search books with nested fields' | ||
|
||
it 'does a custom search with a matching strategy ALL' do | ||
response = index.search('another french book', matching_strategy: 'all') | ||
|
||
expect(response['hits'].count).to eq(1) | ||
end | ||
|
||
it 'does a custom search with a matching strategy LAST' do | ||
response = index.search('french book', matching_strategy: 'last') | ||
|
||
expect(response['hits'].count).to eq(2) | ||
end | ||
end |