summaryrefslogtreecommitdiff
path: root/spec/controllers/application_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-19 08:27:35 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-19 08:27:35 +0000
commit7e9c479f7de77702622631cff2628a9c8dcbc627 (patch)
treec8f718a08e110ad7e1894510980d2155a6549197 /spec/controllers/application_controller_spec.rb
parente852b0ae16db4052c1c567d9efa4facc81146e88 (diff)
downloadgitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/controllers/application_controller_spec.rb')
-rw-r--r--spec/controllers/application_controller_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index d95aac2f386..9342513d224 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -171,6 +171,8 @@ RSpec.describe ApplicationController do
describe '#route_not_found' do
controller(described_class) do
+ skip_before_action :authenticate_user!, only: :index
+
def index
route_not_found
end
@@ -184,6 +186,14 @@ RSpec.describe ApplicationController do
expect(response).to have_gitlab_http_status(:not_found)
end
+ it 'renders 404 if client is a search engine crawler' do
+ request.env['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
+
+ get :index
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+
it 'redirects to login page if not authenticated' do
get :index