diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 12:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 12:08:47 +0000 |
commit | 4944e9e5a9a3f57998c5033b10cdfa2975b71227 (patch) | |
tree | 37edfc95b65e524425a2ecc2903e23ed9cf41fd4 /spec | |
parent | d9b44a6bb12cbb4d54210bcb21a02b6458a402b4 (diff) | |
download | gitlab-ce-4944e9e5a9a3f57998c5033b10cdfa2975b71227.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 10 | ||||
-rw-r--r-- | spec/graphql/types/countable_connection_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 4 |
3 files changed, 14 insertions, 2 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 diff --git a/spec/graphql/types/countable_connection_type_spec.rb b/spec/graphql/types/countable_connection_type_spec.rb index af34611ecfe..3b3c02baa5d 100644 --- a/spec/graphql/types/countable_connection_type_spec.rb +++ b/spec/graphql/types/countable_connection_type_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe GitlabSchema.types['IssueConnection'] do +RSpec.describe GitlabSchema.types['MergeRequestConnection'] do it 'has the expected fields' do expected_fields = %i[count page_info edges nodes] diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 8a0c5847394..5f643fb03df 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2,12 +2,14 @@ require 'spec_helper' -RSpec.describe Project do +RSpec.describe Project, factory_default: :keep do include ProjectForksHelper include GitHelpers include ExternalAuthorizationServiceHelpers using RSpec::Parameterized::TableSyntax + let_it_be(:namespace) { create_default(:namespace) } + it_behaves_like 'having unique enum values' describe 'associations' do |