From 62f5ebbe105f25c8fa91dc79dfd22edc6f7dff1e Mon Sep 17 00:00:00 2001 From: curquiza Date: Fri, 16 Feb 2024 15:39:20 +0100 Subject: [PATCH] Fix test by removing activation of scoreDetails --- .../search/show_ranking_score_details_spec.rb | 21 +------------------ spec/support/experimental_feature_helpers.rb | 4 ---- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/spec/meilisearch/index/search/show_ranking_score_details_spec.rb b/spec/meilisearch/index/search/show_ranking_score_details_spec.rb index 8bd20668..be577d68 100644 --- a/spec/meilisearch/index/search/show_ranking_score_details_spec.rb +++ b/spec/meilisearch/index/search/show_ranking_score_details_spec.rb @@ -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 diff --git a/spec/support/experimental_feature_helpers.rb b/spec/support/experimental_feature_helpers.rb index e6c71346..c937cd83 100644 --- a/spec/support/experimental_feature_helpers.rb +++ b/spec/support/experimental_feature_helpers.rb @@ -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