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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-07 00:08:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-07 00:08:48 +0300
commita89cb5cbdd832d4d9e80517973aceda6bc0a3856 (patch)
tree574475bd0901a2f8906d36a4728b8bbb95b41e1c /spec/requests/api/users_spec.rb
parent0d6fa033121a9bef708b8f2de186c4034c61d4a3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r--spec/requests/api/users_spec.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 84e1f95828a..f6ff2020c79 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -778,6 +778,12 @@ describe API::Users do
expect(user.reload.external?).to be_truthy
end
+ it "private profile is false by default" do
+ put api("/users/#{user.id}", admin), params: {}
+
+ expect(user.reload.private_profile).to eq(false)
+ end
+
it "updates private profile" do
put api("/users/#{user.id}", admin), params: { private_profile: true }
@@ -785,14 +791,24 @@ describe API::Users do
expect(user.reload.private_profile).to eq(true)
end
- it "updates private profile when nil is given to false" do
- admin.update(private_profile: true)
+ it "updates private profile to false when nil is given" do
+ user.update(private_profile: true)
put api("/users/#{user.id}", admin), params: { private_profile: nil }
+ expect(response).to have_gitlab_http_status(200)
expect(user.reload.private_profile).to eq(false)
end
+ it "does not modify private profile when field is not provided" do
+ user.update(private_profile: true)
+
+ put api("/users/#{user.id}", admin), params: {}
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(user.reload.private_profile).to eq(true)
+ end
+
it "does not update admin status" do
put api("/users/#{admin_user.id}", admin), params: { can_create_group: false }