diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/controllers/concerns | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/controllers/concerns')
22 files changed, 24 insertions, 28 deletions
diff --git a/spec/controllers/concerns/boards_responses_spec.rb b/spec/controllers/concerns/boards_responses_spec.rb index bdebdf94761..553a547d42c 100644 --- a/spec/controllers/concerns/boards_responses_spec.rb +++ b/spec/controllers/concerns/boards_responses_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BoardsResponses do +RSpec.describe BoardsResponses do let(:controller_class) do Class.new do include BoardsResponses diff --git a/spec/controllers/concerns/checks_collaboration_spec.rb b/spec/controllers/concerns/checks_collaboration_spec.rb index 7187e239486..be8beff5dd6 100644 --- a/spec/controllers/concerns/checks_collaboration_spec.rb +++ b/spec/controllers/concerns/checks_collaboration_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChecksCollaboration do +RSpec.describe ChecksCollaboration do include ProjectForksHelper let(:helper) do diff --git a/spec/controllers/concerns/confirm_email_warning_spec.rb b/spec/controllers/concerns/confirm_email_warning_spec.rb index 93e3423261c..24ee6fb30d2 100644 --- a/spec/controllers/concerns/confirm_email_warning_spec.rb +++ b/spec/controllers/concerns/confirm_email_warning_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ConfirmEmailWarning do +RSpec.describe ConfirmEmailWarning do before do stub_feature_flags(soft_email_confirmation: true) end diff --git a/spec/controllers/concerns/continue_params_spec.rb b/spec/controllers/concerns/continue_params_spec.rb index 6af01aa837c..c010e8ffbd0 100644 --- a/spec/controllers/concerns/continue_params_spec.rb +++ b/spec/controllers/concerns/continue_params_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ContinueParams do +RSpec.describe ContinueParams do let(:controller_class) do Class.new(ActionController::Base) do include ContinueParams diff --git a/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb b/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb index 3f9d690837b..a58b83dc42c 100644 --- a/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb +++ b/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ControllerWithCrossProjectAccessCheck do +RSpec.describe ControllerWithCrossProjectAccessCheck do let(:user) { create(:user) } before do diff --git a/spec/controllers/concerns/enforces_admin_authentication_spec.rb b/spec/controllers/concerns/enforces_admin_authentication_spec.rb index 1809bb2d636..c6ad1a00484 100644 --- a/spec/controllers/concerns/enforces_admin_authentication_spec.rb +++ b/spec/controllers/concerns/enforces_admin_authentication_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EnforcesAdminAuthentication do +RSpec.describe EnforcesAdminAuthentication do include AdminModeHelper let(:user) { create(:user) } diff --git a/spec/controllers/concerns/group_tree_spec.rb b/spec/controllers/concerns/group_tree_spec.rb index 543f0170be0..a0707688e54 100644 --- a/spec/controllers/concerns/group_tree_spec.rb +++ b/spec/controllers/concerns/group_tree_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupTree do +RSpec.describe GroupTree do let(:group) { create(:group, :public) } let(:user) { create(:user) } diff --git a/spec/controllers/concerns/import_url_params_spec.rb b/spec/controllers/concerns/import_url_params_spec.rb index 41e29d71386..72f13cdcc94 100644 --- a/spec/controllers/concerns/import_url_params_spec.rb +++ b/spec/controllers/concerns/import_url_params_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ImportUrlParams do +RSpec.describe ImportUrlParams do let(:import_url_params) do controller = OpenStruct.new(params: params).extend(described_class) controller.import_url_params diff --git a/spec/controllers/concerns/internal_redirect_spec.rb b/spec/controllers/concerns/internal_redirect_spec.rb index cc6422f2817..3741ff647e4 100644 --- a/spec/controllers/concerns/internal_redirect_spec.rb +++ b/spec/controllers/concerns/internal_redirect_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe InternalRedirect do +RSpec.describe InternalRedirect do let(:controller_class) do Class.new do include InternalRedirect diff --git a/spec/controllers/concerns/issuable_actions_spec.rb b/spec/controllers/concerns/issuable_actions_spec.rb index 2ab46992b99..c3fef591b91 100644 --- a/spec/controllers/concerns/issuable_actions_spec.rb +++ b/spec/controllers/concerns/issuable_actions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IssuableActions do +RSpec.describe IssuableActions do let(:project) { double('project') } let(:user) { double('user') } let(:issuable) { double('issuable') } diff --git a/spec/controllers/concerns/issuable_collections_spec.rb b/spec/controllers/concerns/issuable_collections_spec.rb index 7bdf5c49425..befdd760965 100644 --- a/spec/controllers/concerns/issuable_collections_spec.rb +++ b/spec/controllers/concerns/issuable_collections_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IssuableCollections do +RSpec.describe IssuableCollections do let(:user) { create(:user) } let(:controller) do diff --git a/spec/controllers/concerns/lfs_request_spec.rb b/spec/controllers/concerns/lfs_request_spec.rb index f771a3438cf..3bafd761a3e 100644 --- a/spec/controllers/concerns/lfs_request_spec.rb +++ b/spec/controllers/concerns/lfs_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LfsRequest do +RSpec.describe LfsRequest do include ProjectForksHelper controller(Repositories::GitHttpClientController) do diff --git a/spec/controllers/concerns/metrics_dashboard_spec.rb b/spec/controllers/concerns/metrics_dashboard_spec.rb index e2fa03670d9..39ddf687dca 100644 --- a/spec/controllers/concerns/metrics_dashboard_spec.rb +++ b/spec/controllers/concerns/metrics_dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MetricsDashboard do +RSpec.describe MetricsDashboard do include MetricsDashboardHelpers describe 'GET #metrics_dashboard' do @@ -134,7 +134,7 @@ describe MetricsDashboard do it 'adds starred dashboard information and sorts the list' do all_dashboards = json_response['all_dashboards'].map { |dashboard| dashboard.slice('display_name', 'starred', 'user_starred_path') } expected_response = [ - { "display_name" => "Default", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: 'config/prometheus/common_metrics.yml' }) }, + { "display_name" => "Default dashboard", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: 'config/prometheus/common_metrics.yml' }) }, { "display_name" => "anomaly.yml", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/anomaly.yml' }) }, { "display_name" => "errors.yml", "starred" => true, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/errors.yml' }) }, { "display_name" => "test.yml", "starred" => true, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/test.yml' }) } diff --git a/spec/controllers/concerns/page_limiter_spec.rb b/spec/controllers/concerns/page_limiter_spec.rb index 287b62cb66c..a4177943c05 100644 --- a/spec/controllers/concerns/page_limiter_spec.rb +++ b/spec/controllers/concerns/page_limiter_spec.rb @@ -14,7 +14,7 @@ class PageLimiterSpecController < ApplicationController end end -describe PageLimiter do +RSpec.describe PageLimiter do let(:controller_class) do PageLimiterSpecController end diff --git a/spec/controllers/concerns/project_unauthorized_spec.rb b/spec/controllers/concerns/project_unauthorized_spec.rb index 9b40660811e..4fce160cdaf 100644 --- a/spec/controllers/concerns/project_unauthorized_spec.rb +++ b/spec/controllers/concerns/project_unauthorized_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectUnauthorized do +RSpec.describe ProjectUnauthorized do include ExternalAuthorizationServiceHelpers let(:user) { create(:user) } diff --git a/spec/controllers/concerns/redirects_for_missing_path_on_tree_spec.rb b/spec/controllers/concerns/redirects_for_missing_path_on_tree_spec.rb index 903100ba93f..5c3b6e13ee3 100644 --- a/spec/controllers/concerns/redirects_for_missing_path_on_tree_spec.rb +++ b/spec/controllers/concerns/redirects_for_missing_path_on_tree_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RedirectsForMissingPathOnTree, type: :controller do +RSpec.describe RedirectsForMissingPathOnTree, type: :controller do controller(ActionController::Base) do include Gitlab::Routing.url_helpers include RedirectsForMissingPathOnTree diff --git a/spec/controllers/concerns/renders_commits_spec.rb b/spec/controllers/concerns/renders_commits_spec.rb index c43ceb6b795..0bffb39d608 100644 --- a/spec/controllers/concerns/renders_commits_spec.rb +++ b/spec/controllers/concerns/renders_commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RendersCommits do +RSpec.describe RendersCommits do let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:merge_request) { create(:merge_request, source_project: project) } let_it_be(:user) { create(:user) } diff --git a/spec/controllers/concerns/routable_actions_spec.rb b/spec/controllers/concerns/routable_actions_spec.rb index 80c67022219..f28f990ecbb 100644 --- a/spec/controllers/concerns/routable_actions_spec.rb +++ b/spec/controllers/concerns/routable_actions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RoutableActions do +RSpec.describe RoutableActions do controller(::ApplicationController) do include RoutableActions diff --git a/spec/controllers/concerns/send_file_upload_spec.rb b/spec/controllers/concerns/send_file_upload_spec.rb index 3cfb7b5a488..7cfaf1b248f 100644 --- a/spec/controllers/concerns/send_file_upload_spec.rb +++ b/spec/controllers/concerns/send_file_upload_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SendFileUpload do +RSpec.describe SendFileUpload do let(:uploader_class) do Class.new(GitlabUploader) do include ObjectStorage::Concern diff --git a/spec/controllers/concerns/sorting_preference_spec.rb b/spec/controllers/concerns/sorting_preference_spec.rb index a36124c6776..4f9506d4675 100644 --- a/spec/controllers/concerns/sorting_preference_spec.rb +++ b/spec/controllers/concerns/sorting_preference_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SortingPreference do +RSpec.describe SortingPreference do let(:user) { create(:user) } let(:controller_class) do diff --git a/spec/controllers/concerns/sourcegraph_decorator_spec.rb b/spec/controllers/concerns/sourcegraph_decorator_spec.rb index f1f3f0489c6..2fca5a606d8 100644 --- a/spec/controllers/concerns/sourcegraph_decorator_spec.rb +++ b/spec/controllers/concerns/sourcegraph_decorator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SourcegraphDecorator do +RSpec.describe SourcegraphDecorator do let_it_be(:enabled_user) { create(:user, sourcegraph_enabled: true) } let_it_be(:disabled_user) { create(:user, sourcegraph_enabled: false) } let_it_be(:public_project) { create(:project, :public) } @@ -25,7 +25,7 @@ describe SourcegraphDecorator do end before do - Feature.get(:sourcegraph).enable(feature_enabled) + stub_feature_flags(sourcegraph: feature_enabled) stub_application_setting(sourcegraph_url: sourcegraph_url, sourcegraph_enabled: sourcegraph_enabled, sourcegraph_public_only: sourcegraph_public_only) @@ -36,10 +36,6 @@ describe SourcegraphDecorator do sign_in user if user end - after do - Feature.get(:sourcegraph).disable - end - subject do get :index, format: format diff --git a/spec/controllers/concerns/static_object_external_storage_spec.rb b/spec/controllers/concerns/static_object_external_storage_spec.rb index d3ece587ef7..afb43d531c0 100644 --- a/spec/controllers/concerns/static_object_external_storage_spec.rb +++ b/spec/controllers/concerns/static_object_external_storage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe StaticObjectExternalStorage do +RSpec.describe StaticObjectExternalStorage do controller(Projects::ApplicationController) do include StaticObjectExternalStorage |