Skip to content

Reuse shared example in ES filters spec

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Implementation Plan

This MR introduced 'adds filter to query_hash' shared example for testing ES filters ee/spec/support/shared_examples/search/filters_shared_examples.rb.

Let's reuse this example in the following spec ee/spec/lib/search/elastic/filters_spec.rb. I omitted doing this as a part of the original MR because the spec is ~4000 lines long and it would be a lot of unrelated changes.

Implementation Plan

  1. Identify test cases in ee/spec/lib/search/elastic/filters_spec.rb that can use the shared example 'adds filter to query_hash'
  2. Replace repetitive test code with calls to the shared example where applicable
  3. Ensure all tests pass after refactoring
  4. Remove any duplicate test logic that's now covered by the shared example

Files to modify:

  • ee/spec/lib/search/elastic/filters_spec.rb

Support contact: @afrnz

Edited by 🤖 GitLab Bot 🤖