summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-04-12 19:08:35 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-04-12 19:08:35 +0200
commit5fb572417e0c331afb62c8bbaa561b0fe7836fc5 (patch)
treee26e6a64d94a26b9a48aa0e998d93538f0fc0ba9 /spec
parentd0cdc2ee73c8421906fbd011d0f44d638616a864 (diff)
downloadgitlab-ce-5fb572417e0c331afb62c8bbaa561b0fe7836fc5.tar.gz
Fix minor issues according development guidelines
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/groups_spec.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index e7ccbff7ae2..7383c7d11aa 100644
--- a/spec/requests/api/groups_spec.rb
+++ b/spec/requests/api/groups_spec.rb
@@ -100,7 +100,7 @@ describe API::API, api: true do
describe 'PUT /groups/:id' do
let(:new_group_name) { 'New Group'}
- context "when authenticated the group owner" do
+ context 'when authenticated as the group owner' do
it 'updates the group' do
put api("/groups/#{group1.id}", user1), name: new_group_name
@@ -115,7 +115,7 @@ describe API::API, api: true do
end
end
- context "when authenticated the admin" do
+ context 'when authenticated as the admin' do
it 'updates the group' do
put api("/groups/#{group1.id}", admin), name: new_group_name
@@ -124,13 +124,21 @@ describe API::API, api: true do
end
end
- context "when authenticated an user" do
- it 'updates the group' do
+ context 'when authenticated as an user that can see the group' do
+ it 'does not updates the group' do
put api("/groups/#{group1.id}", user2), name: new_group_name
expect(response.status).to eq(403)
end
end
+
+ context 'when authenticated as an user that cannot see the group' do
+ it 'returns 403 when trying to update the group' do
+ put api("/groups/#{group2.id}", user1), name: new_group_name
+
+ expect(response.status).to eq(403)
+ end
+ end
end
describe "GET /groups/:id/projects" do