Skip to content

Commit

Permalink
Fix test by removing activation of scoreDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
curquiza committed Feb 16, 2024
1 parent 5b3eb47 commit 62f5ebb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
21 changes: 1 addition & 20 deletions spec/meilisearch/index/search/show_ranking_score_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,12 @@
RSpec.describe 'MeiliSearch::Index - Search with ranking score details' do
include_context 'search books with genre'

it 'experimental feature scoreDetails is not enabled so an error is raised' do
enable_score_details(false)

expect do
index.search('hobbit', { show_ranking_score_details: true })
end.to raise_error(MeiliSearch::ApiError)
end

it 'shows the ranking score details when showRankingScoreDetails is true' do
enable_score_details(true)

it 'shows the ranking score details' do
response = index.search('hobbit', { show_ranking_score_details: true })
expect(response['hits'][0]).to have_key('_rankingScoreDetails')
end

it 'hides the ranking score details when showRankingScoreDetails is false' do
enable_score_details(false)

response = index.search('hobbit', { show_ranking_score_details: false })
expect(response['hits'][0]).not_to have_key('_rankingScoreDetails')
end

it 'hides the ranking score details when showRankingScoreDetails is not set' do
enable_score_details(false)

response = index.search('hobbit')
expect(response['hits'][0]).not_to have_key('_rankingScoreDetails')
end
Expand Down
4 changes: 0 additions & 4 deletions spec/support/experimental_feature_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
require 'json'

module ExperimentalFeatureHelpers
def enable_score_details(toggle)
configure_feature('scoreDetails', toggle)
end

def enable_vector_store(toggle)
configure_feature('vectorStore', toggle)
end
Expand Down

0 comments on commit 62f5ebb

Please sign in to comment.