Clear host memoization for metric embeds feature test
What does this MR do?
!24601 (merged) introduced memoization for regex matchers in Gitlab::Metrics::Dashboard::Url
.
If you run spec/features/markdown/metrics_spec.rb
before or after another test which depends on these regexes, the latter test file will have failures, as metrics_spec.rb
configures a host other than localhost
.
This MR:
- Clears the memoization before and after the
metrics_spec.rb
runs to avoid leaking state to other specs - Changes some spacing which was bothering me
- Updates a spec description to match the corresponding method name which was also changed in !24601 (merged)
Testing
Example of tests which can be run to see the failures & validate the solution:
rspec spec/features/markdown/metrics_spec.rb spec/lib/banzai/filter/inline_metrics_redactor_filter_spec.rb
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Sarah Yasonik