summaryrefslogtreecommitdiff
path: root/spec/requests/api/groups_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/groups_spec.rb')
-rw-r--r--spec/requests/api/groups_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index 56f08249bdd..3bc3cce5310 100644
--- a/spec/requests/api/groups_spec.rb
+++ b/spec/requests/api/groups_spec.rb
@@ -645,7 +645,7 @@ RSpec.describe API::Groups do
project = create(:project, namespace: group2, path: 'Foo')
create(:project_group_link, project: project, group: group1)
- get api("/groups/#{group1.id}", user1), params: { with_projects: false }
+ get api("/groups/#{group2.id}", user1), params: { with_projects: false }
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['projects']).to be_nil
@@ -748,6 +748,18 @@ RSpec.describe API::Groups do
expect(json_response).to include('runners_token')
end
+ it "returns runners_token and no projects when with_projects option is set to false" do
+ project = create(:project, namespace: group2, path: 'Foo')
+ create(:project_group_link, project: project, group: group1)
+
+ get api("/groups/#{group2.id}", admin), params: { with_projects: false }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['projects']).to be_nil
+ expect(json_response['shared_projects']).to be_nil
+ expect(json_response).to include('runners_token')
+ end
+
it "does not return a non existing group" do
get api("/groups/#{non_existing_record_id}", admin)