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:
authorGeorge Andrinopoulos <geoandri@gmail.com>2017-02-02 13:46:14 +0300
committerGeorge Andrinopoulos <geoandri@gmail.com>2017-02-02 13:47:23 +0300
commit19dda1606b4dc76160bf2198ab95f2998eccaec8 (patch)
treea423654e591727b8d15ef878e424f267abbc47a1 /spec/requests/api/users_spec.rb
parentfabdcf818b5bfb45edd3a4ffbf1382b4ec9662d2 (diff)
Force new password after password reset via API
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r--spec/requests/api/users_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 5bf5bf0739e..f9127096953 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -305,6 +305,12 @@ describe API::Users, api: true do
expect(user.reload.bio).to eq('new test bio')
end
+ it "updates user with new password and forces reset on next login" do
+ put api("/users/#{user.id}", admin), { password: '12345678' }
+ expect(response).to have_http_status(200)
+ expect(user.reload.password_expires_at).to be < Time.now
+ end
+
it "updates user with organization" do
put api("/users/#{user.id}", admin), { organization: 'GitLab' }