Skip to content

Extract `where` into shared context for search helper spec

Peter Leitzen requested to merge pl-spec-with-them-search-helper into master

What does this MR do and why?

Defining where in a different scope/example group as with_them won't run any examples.

Contributes to #430870.

How to set up and validate locally

  1. Apply the following patch and bundle:
diff --git a/Gemfile b/Gemfile
index 1536fa6bafec..c3bd4ce91b30 100644
--- a/Gemfile
+++ b/Gemfile
@@ -475,6 +475,8 @@ group :test do
   gem 'rspec_profiling', '~> 0.0.6', feature_category: :tooling
   gem 'rspec-benchmark', '~> 0.6.0', feature_category: :tooling
   gem 'rspec-parameterized', '~> 1.0', require: false, feature_category: :tooling
+  gem 'rspec-parameterized-core', '~> 1.0', require: false, feature_category: :tooling,
+    git: 'https://github.com/splattael/rspec-parameterized-core', ref: 'warnings'
 
   gem 'capybara', '~> 3.39', '>= 3.39.2' # rubocop:todo Gemfile/MissingFeatureCategory
   gem 'capybara-screenshot', '~> 1.0.26' # rubocop:todo Gemfile/MissingFeatureCategory
  1. bin/rspec --dry-run spec/helpers/search_helper_spec.rb -e search_service
  2. Verify that related examples are present/printed
  3. Verify the absence of All examples were filtered out; ignoring {:full_description=>/search_service/}
  4. Verify the absence of spec/helpers/search_helper_spec.rb:814: "where" not defined. warnings.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports