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:
authorYorick Peterse <yorickpeterse@gmail.com>2015-11-18 14:32:35 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2015-11-18 15:05:45 +0300
commitfbdf3767495cd60b002f24ab4e9aa4d0c019de95 (patch)
treec62a5d51292ad950107b256078aea82322b65b06 /spec/controllers
parente116a356b8ac07bd3a935c40ceb274d67d808c83 (diff)
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')
-rw-r--r--spec/controllers/users_controller_spec.rb23
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