Commit 8756cf51 authored by Rémy Coutable's avatar Rémy Coutable

Improve the en/dis-ablement of the ES feature in a flaky test

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 50967e64
......@@ -2,21 +2,27 @@
require 'spec_helper'
RSpec.describe ElasticNamespaceIndexerWorker, :elastic do
RSpec.describe ElasticNamespaceIndexerWorker do
subject { described_class.new }
context 'when ES is disabled' do
before do
stub_ee_application_setting(elasticsearch_indexing: true)
stub_ee_application_setting(elasticsearch_limit_indexing: true)
end
it 'returns true if ES disabled' do
stub_ee_application_setting(elasticsearch_indexing: false)
stub_ee_application_setting(elasticsearch_limit_indexing: false)
end
it 'returns true' do
expect(Elastic::ProcessInitialBookkeepingService).not_to receive(:backfill_projects!)
expect(subject.perform(1, "index")).to be_truthy
end
end
context 'when ES is enabled', :elastic do
before do
stub_ee_application_setting(elasticsearch_indexing: true)
stub_ee_application_setting(elasticsearch_limit_indexing: true)
end
it 'returns true if limited indexing is not enabled' do
stub_ee_application_setting(elasticsearch_limit_indexing: false)
......@@ -43,4 +49,5 @@ RSpec.describe ElasticNamespaceIndexerWorker, :elastic do
subject.perform(namespace.id, :delete)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment