Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2018-07-17 08:48:39 +0300
committerRubén Dávila <ruben@gitlab.com>2018-07-17 08:48:39 +0300
commitdcae1cc908532bb0f8e12f446e542108b90ad59f (patch)
tree2db77cd8ef569896f2c44b93face70bffb10a995 /spec/helpers
parent7f0431dd8550ac9d229d1383c03386c1634d015f (diff)
Add avatar_url attr to the response of the autocomplete endpoint
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/search_helper_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb
index 6c9a7febf14..8bfd520528f 100644
--- a/spec/helpers/search_helper_spec.rb
+++ b/spec/helpers/search_helper_spec.rb
@@ -55,6 +55,20 @@ describe SearchHelper do
expect(search_autocomplete_opts(project.name).size).to eq(1)
end
+ it "includes the required project attrs" do
+ project = create(:project, namespace: create(:namespace, owner: user))
+ result = search_autocomplete_opts(project.name).first
+
+ expect(result.keys).to match_array(%i[category id value label url avatar_url])
+ end
+
+ it "includes the required group attrs" do
+ create(:group).add_owner(user)
+ result = search_autocomplete_opts("gro").first
+
+ expect(result.keys).to match_array(%i[category id label url avatar_url])
+ end
+
it "does not include the public group" do
group = create(:group)
expect(search_autocomplete_opts(group.name).size).to eq(0)