diff options
author | Stan Hu <stanhu@gmail.com> | 2015-07-01 22:26:14 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-07-02 04:22:51 -0700 |
commit | 3e738e3b9aeae5620116109258c4d4da84180e7e (patch) | |
tree | d433a56409141671d9c56e6bca3e0ce16f546ce5 /spec | |
parent | 2ca7ffd094ae285823d1a00b8cf1a7d23b80a2a3 (diff) | |
download | gitlab-ce-3e738e3b9aeae5620116109258c4d4da84180e7e.tar.gz |
Add support for unlocking users in admin settings
Closes https://github.com/gitlabhq/gitlabhq/issues/9381
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/admin/users_controller_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index f27e861e175..550a91a79e2 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -21,4 +21,19 @@ describe Admin::UsersController do expect { User.find(user.id) }.to raise_exception(ActiveRecord::RecordNotFound) end end + + describe 'PUT unlock/:id' do + let(:user) { create(:user) } + + before do + request.env["HTTP_REFERER"] = "/" + user.lock_access! + end + + it 'unlocks user' do + put :unlock, id: user.username + user.reload + expect(user.access_locked?).to be_falsey + end + end end |