Write the specs properly
What does this MR do and why?
I have noticed some specs were not written properly.
-
ee/spec/lib/elastic/latest/git_class_proxy_spec.rb
: Send one more project_id in theoptions[:project_ids]
to test the multiple routing feature. I found that it was not working so I had to change the stubbing strategy in the fileee/spec/support/helpers/elasticsearch_helpers.rb
-
ee/spec/lib/gitlab/elastic/search_results_spec.rb
:project_id
will always be present in the_source
so added this field also in the_source
for the test. To give the context why I fixed this because in the case of GroupWikiproject_id
will be missing and that's how I will differentiate the Group level search from the project-level search -
ee/spec/services/search/group_service_spec.rb
: It is a group search, so project should be under a group. We were settinggroup
asproject.namespace
but again the issue isproject.namespace
is aUserNamespace
. Similar case as the first one. -
ee/spec/support/helpers/elasticsearch_helpers.rb
: When there is multiple routing likerouting=project_1,project_2
, thecomma(,)
was getting encoded in%2C
and the stubbing was not working, so I have used the regex to create URI.
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.