diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 07:33:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 07:33:21 +0000 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/support/shared_contexts | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) | |
download | gitlab-ce-36a59d088eca61b834191dacea009677a96c052f.tar.gz |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/support/shared_contexts')
9 files changed, 25 insertions, 25 deletions
diff --git a/spec/support/shared_contexts/email_shared_context.rb b/spec/support/shared_contexts/email_shared_context.rb index 0dc66eeb2ee..086cdf50e9d 100644 --- a/spec/support/shared_contexts/email_shared_context.rb +++ b/spec/support/shared_contexts/email_shared_context.rb @@ -148,7 +148,7 @@ RSpec.shared_examples :note_handler_shared_examples do |forwardable| end it 'allows email to only have quoted text', if: forwardable do - expect { receiver.execute }.not_to raise_error(Gitlab::Email::EmptyEmailError) + expect { receiver.execute }.not_to raise_error end end diff --git a/spec/support/shared_contexts/graphql/requests/packages_shared_context.rb b/spec/support/shared_contexts/graphql/requests/packages_shared_context.rb index 13e7ecf2669..b29a231f3a6 100644 --- a/spec/support/shared_contexts/graphql/requests/packages_shared_context.rb +++ b/spec/support/shared_contexts/graphql/requests/packages_shared_context.rb @@ -14,7 +14,7 @@ RSpec.shared_context 'package details setup' do let(:user) { project.first_owner } let(:package_details) { graphql_data_at(:package) } let(:metadata_response) { graphql_data_at(:package, :metadata) } - let(:first_file) { package.package_files.find { |f| global_id_of(f) == first_file_response['id'] } } + let(:first_file) { package.package_files.find { |f| a_graphql_entity_for(f).matches?(first_file_response) } } let(:package_files_response) { graphql_data_at(:package, :package_files, :nodes) } let(:first_file_response) { graphql_data_at(:package, :package_files, :nodes, 0)} let(:first_file_response_metadata) { graphql_data_at(:package, :package_files, :nodes, 0, :file_metadata)} diff --git a/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb b/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb index b7966e25b38..7d51c90522a 100644 --- a/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb +++ b/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb @@ -57,7 +57,8 @@ RSpec.shared_context 'structured_logger' do 'job_status' => 'done', 'duration_s' => 0.0, 'completed_at' => timestamp.to_f, - 'cpu_s' => 1.111112 + 'cpu_s' => 1.111112, + 'rate_limiting_gates' => [] ) end diff --git a/spec/support/shared_contexts/models/concerns/integrations/enable_ssl_verification_shared_context.rb b/spec/support/shared_contexts/models/concerns/integrations/enable_ssl_verification_shared_context.rb index c698e06c2a2..fbec6f98e76 100644 --- a/spec/support/shared_contexts/models/concerns/integrations/enable_ssl_verification_shared_context.rb +++ b/spec/support/shared_contexts/models/concerns/integrations/enable_ssl_verification_shared_context.rb @@ -43,5 +43,9 @@ RSpec.shared_context Integrations::EnableSslVerification do expect(names.index('enable_ssl_verification')).to eq insert_index end + + it 'does not insert the field repeatedly' do + expect(integration.fields.pluck(:name)).to eq(integration.fields.pluck(:name)) + end end end diff --git a/spec/support/shared_contexts/navbar_structure_context.rb b/spec/support/shared_contexts/navbar_structure_context.rb index 65c7f63cf6e..ef6ff7be840 100644 --- a/spec/support/shared_contexts/navbar_structure_context.rb +++ b/spec/support/shared_contexts/navbar_structure_context.rb @@ -46,8 +46,7 @@ RSpec.shared_context 'project navbar structure' do _('List'), _('Boards'), _('Service Desk'), - _('Milestones'), - (_('Iterations') if Gitlab.ee?) + _('Milestones') ] }, { @@ -74,6 +73,13 @@ RSpec.shared_context 'project navbar structure' do ] }, { + nav_item: _('Infrastructure'), + nav_sub_items: [ + _('Kubernetes clusters'), + _('Terraform') + ] + }, + { nav_item: _('Monitor'), nav_sub_items: [ _('Metrics'), @@ -86,16 +92,8 @@ RSpec.shared_context 'project navbar structure' do ] }, { - nav_item: _('Infrastructure'), - nav_sub_items: [ - _('Kubernetes clusters'), - _('Serverless platform'), - _('Terraform') - ] - }, - { nav_item: _('Analytics'), - nav_sub_items: analytics_sub_nav_item + nav_sub_items: project_analytics_sub_nav_item }, { nav_item: _('Wiki'), @@ -126,9 +124,7 @@ RSpec.shared_context 'group navbar structure' do let(:analytics_nav_item) do { nav_item: _('Analytics'), - nav_sub_items: [ - _('Contribution') - ] + nav_sub_items: group_analytics_sub_nav_item } end diff --git a/spec/support/shared_contexts/policies/group_policy_shared_context.rb b/spec/support/shared_contexts/policies/group_policy_shared_context.rb index 76db2bd82f1..483bca07ba6 100644 --- a/spec/support/shared_contexts/policies/group_policy_shared_context.rb +++ b/spec/support/shared_contexts/policies/group_policy_shared_context.rb @@ -28,11 +28,11 @@ RSpec.shared_context 'GroupPolicy context' do let(:reporter_permissions) do %i[ admin_label + admin_milestone admin_issue_board read_container_image read_metrics_dashboard_annotation read_prometheus - read_package_settings read_crm_contact read_crm_organization ] @@ -40,13 +40,11 @@ RSpec.shared_context 'GroupPolicy context' do let(:developer_permissions) do %i[ - admin_milestone create_metrics_dashboard_annotation delete_metrics_dashboard_annotation update_metrics_dashboard_annotation create_custom_emoji create_package - create_package_settings read_cluster ] end @@ -54,6 +52,7 @@ RSpec.shared_context 'GroupPolicy context' do let(:maintainer_permissions) do %i[ destroy_package + admin_package create_projects create_cluster update_cluster admin_cluster add_cluster ] diff --git a/spec/support/shared_contexts/policies/project_policy_shared_context.rb b/spec/support/shared_contexts/policies/project_policy_shared_context.rb index a78953e8199..e50083a10e7 100644 --- a/spec/support/shared_contexts/policies/project_policy_shared_context.rb +++ b/spec/support/shared_contexts/policies/project_policy_shared_context.rb @@ -25,7 +25,7 @@ RSpec.shared_context 'ProjectPolicy context' do let(:base_reporter_permissions) do %i[ - admin_issue admin_issue_link admin_label admin_issue_board_list + admin_issue admin_issue_link admin_label admin_milestone admin_issue_board_list create_snippet create_incident daily_statistics create_merge_request_in download_code download_wiki_code fork_project metrics_dashboard read_build read_commit_status read_confidential_issues read_container_image @@ -41,7 +41,7 @@ RSpec.shared_context 'ProjectPolicy context' do let(:developer_permissions) do %i[ - admin_merge_request admin_milestone admin_tag create_build + admin_merge_request admin_tag create_build create_commit_status create_container_image create_deployment create_environment create_merge_request_from create_metrics_dashboard_annotation create_pipeline create_release diff --git a/spec/support/shared_contexts/sentry_error_tracking_shared_context.rb b/spec/support/shared_contexts/sentry_error_tracking_shared_context.rb index 3453f954c9d..e8ccb12e6b7 100644 --- a/spec/support/shared_contexts/sentry_error_tracking_shared_context.rb +++ b/spec/support/shared_contexts/sentry_error_tracking_shared_context.rb @@ -14,7 +14,7 @@ RSpec.shared_context 'sentry error tracking context' do end before do - expect(project).to receive(:error_tracking_setting).at_least(:once).and_return(error_tracking_setting) + allow(project).to receive(:error_tracking_setting).at_least(:once).and_return(error_tracking_setting) project.add_reporter(user) end diff --git a/spec/support/shared_contexts/services/service_ping/stubbed_service_ping_metrics_definitions_shared_context.rb b/spec/support/shared_contexts/services/service_ping/stubbed_service_ping_metrics_definitions_shared_context.rb index 37d410a35bf..9746d287440 100644 --- a/spec/support/shared_contexts/services/service_ping/stubbed_service_ping_metrics_definitions_shared_context.rb +++ b/spec/support/shared_contexts/services/service_ping/stubbed_service_ping_metrics_definitions_shared_context.rb @@ -43,12 +43,12 @@ RSpec.shared_context 'stubbed service ping metrics definitions' do Gitlab::Usage::MetricDefinition.instance_variable_set(:@all, nil) end - def metric_attributes(key_path, category, value_type = 'string', instrumentation_class = '') + def metric_attributes(key_path, category, value_type = 'string', instrumentation_class = '', status = 'active') { 'key_path' => key_path, 'data_category' => category, 'value_type' => value_type, - 'status' => 'active', + 'status' => status, 'instrumentation_class' => instrumentation_class, 'time_frame' => 'all' } |