summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-07 07:04:21 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-07 07:04:21 +0000
commiteebd18c3ac6a77e29693c8e1892782acdf20e262 (patch)
treebe50fd759672288bbda8694d49c0f8c43563d175 /spec/requests
parent1d749356c30bc18be5805dac7bc49565782ec30d (diff)
parentbf6961cad85ab9a60f37f9b2974fb7bdd3975810 (diff)
downloadgitlab-ce-eebd18c3ac6a77e29693c8e1892782acdf20e262.tar.gz
Merge branch '2563-backport-ee1942' into 'master'
Backport some EE changes from adding shared_runners_minutes_limit to the API Closes gitlab-ee#2563 See merge request !11936
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/users_spec.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 4efc3e1a1e2..ec51b96c86b 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -426,9 +426,14 @@ describe API::Users do
expect(user.reload.email).not_to eq('invalid email')
end
- it "is not available for non admin users" do
- put api("/users/#{user.id}", user), attributes_for(:user)
- expect(response).to have_http_status(403)
+ context 'when the current user is not an admin' do
+ it "is not available" do
+ expect do
+ put api("/users/#{user.id}", user), attributes_for(:user)
+ end.not_to change { user.reload.attributes }
+
+ expect(response).to have_http_status(403)
+ end
end
it "returns 404 for non-existing user" do
@@ -649,7 +654,7 @@ describe API::Users do
end
it "returns a 404 for invalid ID" do
- put api("/users/ASDF/emails", admin)
+ get api("/users/ASDF/emails", admin)
expect(response).to have_http_status(404)
end