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
path: root/spec
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-05-05 00:20:13 +0300
committerMichael Kozono <mkozono@gmail.com>2017-05-05 22:12:50 +0300
commit9e48f02ea802814e4df1f1de5ed509942dca7581 (patch)
treee1bcb152e7951e1bbd94d6a8333fd475dcfaf577 /spec
parente4bcc90d95fa3b78544cb9ddd6019a5f914c1628 (diff)
Dry up routable lookups. Fixes #30317
Note: This changes the behavior of user lookups (see the spec change) so it acts the same way as groups and projects. Unauthenticated clients attempting to access a user page will be redirected to login whether the user exists and is publicly restricted, or does not exist at all.
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/users_controller_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 5e8caa89cb7..9b6b9358a40 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -36,9 +36,9 @@ describe UsersController do
end
context 'when logged out' do
- it 'renders 404' do
+ it 'redirects to login page' do
get :show, username: user.username
- expect(response).to have_http_status(404)
+ expect(response).to redirect_to new_user_session_path
end
end
@@ -88,9 +88,9 @@ describe UsersController do
context 'when a user by that username does not exist' do
context 'when logged out' do
- it 'renders 404 (does not redirect to login)' do
+ it 'redirects to login page' do
get :show, username: 'nonexistent'
- expect(response).to have_http_status(404)
+ expect(response).to redirect_to new_user_session_path
end
end