From ce57cc17e304b0a4af123c1599f37fb892a5d93a Mon Sep 17 00:00:00 2001 From: Takumasa Ochi Date: Tue, 2 Mar 2021 02:43:54 +0900 Subject: [PATCH] Remove unnecessary exception test on index checking Since we are using `ignore: 404` instead of manual `rescue` at `Elasticsearch::Model::Indexing`, there is no need to stub exceptions in the test. --- .../spec/elasticsearch/model/indexing_spec.rb | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/elasticsearch-model/spec/elasticsearch/model/indexing_spec.rb b/elasticsearch-model/spec/elasticsearch/model/indexing_spec.rb index 09e7717d5..281865a63 100644 --- a/elasticsearch-model/spec/elasticsearch/model/indexing_spec.rb +++ b/elasticsearch-model/spec/elasticsearch/model/indexing_spec.rb @@ -659,36 +659,6 @@ def changes expect(DummyIndexingModel.index_exists?).to be(false) end end - - context 'when the index API raises an error' do - - let(:client) do - double('client').tap do |cl| - expect(cl).to receive(:indices).and_raise(StandardError) - end - end - - it 'returns false' do - expect(DummyIndexingModel.index_exists?).to be(false) - end - end - - context 'when the indices.exists API raises an error' do - - let(:client) do - double('client', indices: indices) - end - - let(:indices) do - double('indices').tap do |ind| - expect(ind).to receive(:exists).and_raise(StandardError) - end - end - - it 'returns false' do - expect(DummyIndexingModel.index_exists?).to be(false) - end - end end describe '#delete_index!' do