Extract `where` into shared context for project policy spec
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
- 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
bin/rspec --dry-run spec/policies/project_policy_spec.rb -e "infrastructure feature"
- Verify that related examples are present/printed
- Verify the absence of
All examples were filtered out; ignoring {:full_description=>/search_service/}
- Verify the absence of
spec/policies/project_policy_spec.rb:2457: "where" not defined.
warnings.
Before
bin/rspec -f p --dry-run spec/policies/project_policy_spec.rb -e "infrastructure feature"
....................................
Finished in 0.01965 seconds (files took 14.84 seconds to load)
36 examples, 0 failures
Randomized with seed 50402
After
bin/rspec -f p --dry-run spec/policies/project_policy_spec.rb -e "infrastructure feature"
........................................................................
Finished in 0.02419 seconds (files took 12.36 seconds to load)
72 examples, 0 failures
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen