diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-18 12:32:35 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-18 13:05:45 +0100 |
commit | fbdf3767495cd60b002f24ab4e9aa4d0c019de95 (patch) | |
tree | c62a5d51292ad950107b256078aea82322b65b06 /spec/controllers/users_controller_spec.rb | |
parent | e116a356b8ac07bd3a935c40ceb274d67d808c83 (diff) | |
download | gitlab-ce-fbdf3767495cd60b002f24ab4e9aa4d0c019de95.tar.gz |
Refactor UsersController to not kill the database
Previously this controller would in multiple places load tons (read:
around 65000) project and/or group IDs into memory. These changes in
combination with the previous commits significantly cut down loading
times of user profile pages and the Atom feeds of users.
Diffstat (limited to 'spec/controllers/users_controller_spec.rb')
-rw-r--r-- | spec/controllers/users_controller_spec.rb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 9f89101d7f7..104a5f50143 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -16,13 +16,26 @@ describe UsersController do context 'with rendered views' do render_views - it 'renders the show template' do - sign_in(user) + describe 'when logged in' do + before do + sign_in(user) + end - get :show, username: user.username + it 'renders the show template' do + get :show, username: user.username - expect(response).to be_success - expect(response).to render_template('show') + expect(response).to be_success + expect(response).to render_template('show') + end + end + + describe 'when logged out' do + it 'renders the show template' do + get :show, username: user.username + + expect(response).to be_success + expect(response).to render_template('show') + end end end end |