diff options
author | Robert Speicher <robert@gitlab.com> | 2016-11-04 12:50:17 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-11-04 12:50:17 +0000 |
commit | 588bc001e27080d2583781426e2336ffa09f70e5 (patch) | |
tree | bb3b96438da32d51a4358dcfea562da57123ad33 /spec | |
parent | 856ef3c303574f9c6554dddf34e6bae5cfa0d4dd (diff) | |
parent | e5c6f943fe6e33510813f05a6f7e6d56af47461a (diff) | |
download | gitlab-ce-588bc001e27080d2583781426e2336ffa09f70e5.tar.gz |
Merge branch 'backport-ee-js-groups-api' into 'master'
Backport Group API code that was added in EE only
Group API code that was added in EE only. /cc @vsizov
See merge request !7205
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/groups_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 3ba257256a0..7b47bf5afc1 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -37,7 +37,7 @@ describe API::API, api: true do end end - context "when authenticated as admin" do + context "when authenticated as admin" do it "admin: returns an array of all groups" do get api("/groups", admin) expect(response).to have_http_status(200) @@ -55,6 +55,17 @@ describe API::API, api: true do expect(json_response.length).to eq(1) end end + + context "when using all_available in request" do + it "returns all groups you have access to" do + public_group = create :group, :public + get api("/groups", user1), all_available: true + + expect(response).to have_http_status(200) + expect(json_response).to be_an Array + expect(json_response.first['name']).to eq(public_group.name) + end + end end describe "GET /groups/:id" do |