WIP: Fixed mocking com environment for specs
What does this MR do?
Adds following fixes to the com
module skeleton files:
-
Fixes the way
com
environment is mocked in specs:-
Thread.current[:is_com]
memoizes the setting for.com
environment. Thus, a better way to mock would be to set the value forThread.current[:is_com]
astrue
forcom-only
specs.
-
-
Adds higher precedence for view and task files under
com
module.- For e.g. if
app/views/test.html.haml
exists inee
andcom
- if the environemtn is.com
, the view fromcom
module should get the precedence.
- For e.g. if
-
Adds
js
,css
andimages
fromcom
module ontoassets_path
Note: It was intentional to not include Pt. (2) and (3) as part of customers-gitlab-com#722 (closed), with the thought process being it may not make sense to add them without any view/asset files actually being present in the module.
However, adding it now as other developers may add view/asset files - and with the config changes not being present, the precedence may not work as expected.
Relates to customers-gitlab-com#722 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance 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