Skip to content

Commit ce57cc1

Browse files
aeroastropicandocodigo
authored andcommitted
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.
1 parent 5db9207 commit ce57cc1

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

elasticsearch-model/spec/elasticsearch/model/indexing_spec.rb

-30
Original file line numberDiff line numberDiff line change
@@ -659,36 +659,6 @@ def changes
659659
expect(DummyIndexingModel.index_exists?).to be(false)
660660
end
661661
end
662-
663-
context 'when the index API raises an error' do
664-
665-
let(:client) do
666-
double('client').tap do |cl|
667-
expect(cl).to receive(:indices).and_raise(StandardError)
668-
end
669-
end
670-
671-
it 'returns false' do
672-
expect(DummyIndexingModel.index_exists?).to be(false)
673-
end
674-
end
675-
676-
context 'when the indices.exists API raises an error' do
677-
678-
let(:client) do
679-
double('client', indices: indices)
680-
end
681-
682-
let(:indices) do
683-
double('indices').tap do |ind|
684-
expect(ind).to receive(:exists).and_raise(StandardError)
685-
end
686-
end
687-
688-
it 'returns false' do
689-
expect(DummyIndexingModel.index_exists?).to be(false)
690-
end
691-
end
692662
end
693663

694664
describe '#delete_index!' do

0 commit comments

Comments
 (0)