File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed
Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 476476 id : 1 ,
477477 title : 'The Red and the Black'
478478 } , 'id' )
479- client . wait_for_task ( task [ 'taskUid' ] )
480- expect ( index . fetch_primary_key ) . to eq ( 'unique' )
481- doc = index . document ( 3 )
482- expect ( doc [ 'unique '] ) . to eq ( 3 )
483- expect ( doc [ 'id '] ) . to eq ( 1 )
484- expect ( doc [ 'title' ] ) . to eq ( 'The Red and the Black ' )
479+
480+ task = client . wait_for_task ( task [ 'taskUid' ] )
481+
482+ expect ( task [ 'status '] ) . to eq ( 'failed' )
483+ expect ( task [ 'type '] ) . to eq ( 'documentAdditionOrUpdate' )
484+ expect ( task [ 'error' ] [ 'code' ] ) . to eq ( 'index_primary_key_already_exists ' )
485485 end
486486 end
487487
521521 task = index . add_documents! ( documents )
522522 update = index . task ( task [ 'uid' ] )
523523 expect ( update [ 'status' ] ) . to eq ( 'failed' )
524- expect ( update [ 'error' ] [ 'code' ] ) . to eq ( 'primary_key_inference_failed ' )
524+ expect ( update [ 'error' ] [ 'code' ] ) . to eq ( 'index_primary_key_no_candidate_found ' )
525525 end
526526 end
527527
Original file line number Diff line number Diff line change 149149 end
150150
151151 it 'fails when updating with wrong ranking rules name' do
152- task = index . update_ranking_rules ( wrong_ranking_rules )
153- task = client . wait_for_task ( task [ 'taskUid' ] )
154-
155- expect ( task [ 'type' ] ) . to eq ( 'settingsUpdate' )
156- expect ( task . keys ) . to include ( 'error' )
157- expect ( task [ 'error' ] [ 'code' ] ) . to eq ( 'invalid_ranking_rule' )
152+ expect do
153+ index . update_ranking_rules ( wrong_ranking_rules )
154+ end . to raise_meilisearch_api_error_with ( 400 , 'invalid_settings_ranking_rules' , 'invalid_request' )
158155 end
159156
160157 it 'resets ranking rules' do
437434 it 'returns an error when the body is invalid' do
438435 expect do
439436 index . update_stop_words ( test : 'test' )
440- end . to raise_bad_request_meilisearch_api_error
437+ end . to raise_meilisearch_api_error_with ( 400 , 'invalid_settings_stop_words' , 'invalid_request' )
441438 end
442439
443440 it 'resets stop-words' do
628625 task = client . wait_for_task ( task [ 'taskUid' ] )
629626
630627 expect ( task . keys ) . to include ( 'error' )
631- expect ( task [ 'error' ] [ 'code' ] ) . to eq ( 'primary_key_inference_failed ' )
628+ expect ( task [ 'error' ] [ 'code' ] ) . to eq ( 'index_primary_key_no_candidate_found ' )
632629 end
633630
634631 it 'adds documents when there is a primary-key' do
You can’t perform that action at this time.
0 commit comments