diff --git a/.rubocop_todo/rspec/receive_messages.yml b/.rubocop_todo/rspec/receive_messages.yml index cfbbb490307c9fc20432d910605a2d34332a4901..2eeb197f8c0eedb4ad4da0786c420de8aec534fb 100644 --- a/.rubocop_todo/rspec/receive_messages.yml +++ b/.rubocop_todo/rspec/receive_messages.yml @@ -169,7 +169,6 @@ RSpec/ReceiveMessages: - 'ee/spec/support/shared_contexts/requests/api/graphql/security_orchestration/policies_shared_contexts.rb' - 'ee/spec/support/shared_contexts/secrets_check_shared_contexts.rb' - 'ee/spec/support/shared_examples/controllers/namespace_storage_limit_alert_shared_examples.rb' - - 'ee/spec/support/shared_examples/elastic/migration_shared_examples.rb' - 'ee/spec/support/shared_examples/graphql/mutations/work_items/update_status_widget_shared_examples.rb' - 'ee/spec/support/shared_examples/graphql/mutations/work_items/update_weight_widget_shared_examples.rb' - 'ee/spec/support/shared_examples/graphql/resolvers/security_orchestration/resolves_orchestration_policy_shared_examples.rb' diff --git a/ee/spec/support/shared_examples/elastic/migration_shared_examples.rb b/ee/spec/support/shared_examples/elastic/migration_shared_examples.rb index a9fe136368f67c08fa7b43e4226a47c9766a464d..77dfc03be64784755c9444207e07ba5058e9a94d 100644 --- a/ee/spec/support/shared_examples/elastic/migration_shared_examples.rb +++ b/ee/spec/support/shared_examples/elastic/migration_shared_examples.rb @@ -71,8 +71,7 @@ end it 'processes in batches', :aggregate_failures do - allow(migration).to receive(:batch_size).and_return(2) - allow(migration).to receive(:update_batch_size).and_return(1) + allow(migration).to receive_messages(batch_size: 2, update_batch_size: 1) expect(::Elastic::ProcessInitialBookkeepingService).to receive(:track!).exactly(3).times.and_call_original @@ -272,8 +271,7 @@ def update_by_query(objects, script) end it 'processes in batches', :aggregate_failures do - allow(migration).to receive(:batch_size).and_return(2) - allow(migration).to receive(:update_batch_size).and_return(1) + allow(migration).to receive_messages(batch_size: 2, update_batch_size: 1) expect(::Elastic::ProcessInitialBookkeepingService).to receive(:track!).exactly(3).times.and_call_original @@ -434,8 +432,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c describe 'reindexing_cleanup!' do context 'when the index already exists' do before do - allow(helper).to receive(:index_exists?).and_return(true) - allow(helper).to receive(:create_standalone_indices).and_return(true) + allow(helper).to receive_messages(index_exists?: true, create_standalone_indices: true) end it 'deletes the index' do @@ -594,8 +591,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c end it 'processes in batches', :aggregate_failures do - allow(migration).to receive(:batch_size).and_return(1) - allow(migration).to receive(:limit_per_iteration).and_return(1) + allow(migration).to receive_messages(batch_size: 1, limit_per_iteration: 1) expect(::Elastic::ProcessInitialBookkeepingService).to receive(:track!) .exactly(objects.size).times.and_call_original @@ -646,8 +642,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c before do stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true) set_elasticsearch_migration_to(version, including: false) - allow(migration).to receive(:helper).and_return(helper) - allow(migration).to receive(:client).and_return(client) + allow(migration).to receive_messages(helper: helper, client: client) # ensure objects are indexed objects @@ -720,8 +715,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c context 'when task in progress' do before do - allow(migration).to receive(:completed?).and_return(false) - allow(migration).to receive(:client).and_return(client) + allow(migration).to receive_messages(completed?: false, client: client) allow(helper).to receive(:task_status).and_return('completed' => false) migration.set_migration_state(task_id: 'task_1') end