diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-02-25 11:20:41 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-02-25 11:20:41 +0000 |
commit | e5c7027faffb75f1d2f7221fa11609741010d82f (patch) | |
tree | d5270f59a827010355b45344c6a79114f8b95a36 /spec/controllers/admin | |
parent | c39e094bc863180e351d36207b98b1680c4c8e5d (diff) | |
parent | e87c255d9e76fb3ca691267107e83d48c90bc816 (diff) | |
download | gitlab-ce-e5c7027faffb75f1d2f7221fa11609741010d82f.tar.gz |
Merge branch 'sh-fix-users-controller-ruby-2.6-compat' into 'master'
Make Admin::UsersController work with Ruby 2.6
See merge request gitlab-org/gitlab-ce!25316
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r-- | spec/controllers/admin/users_controller_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index c934db9e237..cb24a6ef142 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -8,6 +8,20 @@ describe Admin::UsersController do sign_in(admin) end + describe 'GET #index' do + it 'retrieves all users' do + get :index + + expect(assigns(:users)).to match_array([user, admin]) + end + + it 'filters by admins' do + get :index, params: { filter: 'admins' } + + expect(assigns(:users)).to eq([admin]) + end + end + describe 'GET :id' do it 'finds a user case-insensitively' do user = create(:user, username: 'CaseSensitive') |