diff options
author | George Andrinopoulos <geoandri@gmail.com> | 2017-02-02 17:15:02 +0200 |
---|---|---|
committer | George Andrinopoulos <geoandri@gmail.com> | 2017-02-02 17:15:02 +0200 |
commit | d796e4fc371a8613e77c70f5571813818c6a35ad (patch) | |
tree | f5256d27e7ebc2eb4509be273c5c28997332e0e1 | |
parent | 19dda1606b4dc76160bf2198ab95f2998eccaec8 (diff) | |
download | gitlab-ce-d796e4fc371a8613e77c70f5571813818c6a35ad.tar.gz |
Update api docs and minor changes
-rw-r--r-- | doc/api/users.md | 1 | ||||
-rw-r--r-- | spec/requests/api/users_spec.rb | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/api/users.md b/doc/api/users.md index 28b6c7bd491..fea9bdf9639 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -271,6 +271,7 @@ Parameters: - `can_create_group` (optional) - User can create groups - true or false - `external` (optional) - Flags the user as external - true or false(default) +On password update, user will be forced to change it upon next login. Note, at the moment this method does only return a `404` error, even in cases where a `409` (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one. diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index f9127096953..8692f9da976 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -306,9 +306,10 @@ describe API::Users, api: true do end it "updates user with new password and forces reset on next login" do - put api("/users/#{user.id}", admin), { password: '12345678' } + 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 + expect(user.reload.password_expires_at).to be <= Time.now end it "updates user with organization" do |