Allow shared examples to be inline
What does this MR do?
@digitalmoksha asked if shared_examples
had to go into the spec/support/shared_examples
folder, even if the examples were only ever used in one file.
According to our Testing Best Practices
All shared examples should be placed under
spec/support/shared_examples/
.
When asked in chat, @rspeicher replied:
To my knowledge there's not a rule. It's fine to declare them inline if they're only used by multiple tests in a single file, for example. But generally if multiple tests are/will use them, it makes sense to be in a shared file that's included everywhere.
So this MR helps our testing docs reflect reality
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
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team