From c958bf1d1636e0d74bef5a511e20b4ea49048635 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 16 Dec 2024 12:46:19 -0700 Subject: [PATCH] # Testing invalid argument Signed-off-by: Theo Truong --- .../integration/security_enabled/client_integration_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/opensearch/client/integration/security_enabled/client_integration_spec.rb b/spec/opensearch/client/integration/security_enabled/client_integration_spec.rb index 40195328b..7ddf3a051 100644 --- a/spec/opensearch/client/integration/security_enabled/client_integration_spec.rb +++ b/spec/opensearch/client/integration/security_enabled/client_integration_spec.rb @@ -84,7 +84,7 @@ client.indices.delete(index: 'movies') # Execute delete index without providing index name - expect { client.indices.delete }.to raise_error(ArgumentError) + expect { client.indices.delete }.to raise_error 'Required argument \'index\' missing' # Delete a non-existent index without ignoring 404 expect { client.indices.delete(index: 'movies') }.to raise_error(OpenSearch::Transport::Transport::Errors::NotFound) @@ -92,6 +92,9 @@ # Delete a non-existent index ignoring 404 expect(client.indices.delete(index: 'movies', ignore: [404])).to be_falsey + # Using unsupported query parameter + expect { client.ping(invalid: 'invalid') }.to raise_error 'URL parameter \'invalid\' is not supported' + # Create, get, and delete an index with HTTP methods client.http.put('books', body: { settings: { number_of_shards: 1, number_of_replicas: 0 } }) expect(client.http.get('books')['books']['settings']['index']['number_of_shards']).to eq '1'