summaryrefslogtreecommitdiff
path: root/spec/controllers/application_controller_spec.rb
diff options
context:
space:
mode:
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