Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-30 06:08:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-30 06:08:09 +0300
commitf80c3dfdfca4bd0c966cf78449dc5d8e529de4ed (patch)
tree996e4be27947bc74b6929a36aa12011cc21adbd4 /spec
parent091b62a1599d0450fd6b90639a7bea9459f2afdc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/error_tracking/user_filters_errors_by_status_spec.rb2
-rw-r--r--spec/features/error_tracking/user_searches_sentry_errors_spec.rb2
-rw-r--r--spec/features/error_tracking/user_sees_error_details_spec.rb2
-rw-r--r--spec/features/error_tracking/user_sees_error_index_spec.rb2
-rw-r--r--spec/features/groups_spec.rb8
-rw-r--r--spec/features/help_pages_spec.rb8
-rw-r--r--spec/features/ics/dashboard_issues_spec.rb67
-rw-r--r--spec/features/ics/group_issues_spec.rb11
-rw-r--r--spec/features/ics/project_issues_spec.rb11
-rw-r--r--spec/features/incidents/incident_timeline_events_spec.rb6
-rw-r--r--spec/features/incidents/user_views_incident_spec.rb10
-rw-r--r--spec/features/issuables/issuable_list_spec.rb4
-rw-r--r--spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb7
-rw-r--r--spec/features/issues/user_creates_branch_and_merge_request_spec.rb20
-rw-r--r--spec/features/issues/user_filters_issues_spec.rb12
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml1
-rw-r--r--spec/models/application_setting_spec.rb21
17 files changed, 121 insertions, 73 deletions
diff --git a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb
index 168c4f330ca..5efcb5f8b8e 100644
--- a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb
+++ b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'When a user filters Sentry errors by status', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline,
-feature_category: :error_tracking do
+ feature_category: :error_tracking do
include_context 'sentry error tracking context feature'
let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') }
diff --git a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb
index 6026b42f7de..d4c537f1939 100644
--- a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb
+++ b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'When a user searches for Sentry errors', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline,
-feature_category: :error_tracking do
+ feature_category: :error_tracking do
include_context 'sentry error tracking context feature'
let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') }
diff --git a/spec/features/error_tracking/user_sees_error_details_spec.rb b/spec/features/error_tracking/user_sees_error_details_spec.rb
index d7676d90d21..8fcf5df41c7 100644
--- a/spec/features/error_tracking/user_sees_error_details_spec.rb
+++ b/spec/features/error_tracking/user_sees_error_details_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'View error details page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline,
-feature_category: :error_tracking do
+ feature_category: :error_tracking do
include_context 'sentry error tracking context feature'
context 'with current user as project owner' do
diff --git a/spec/features/error_tracking/user_sees_error_index_spec.rb b/spec/features/error_tracking/user_sees_error_index_spec.rb
index f83c8ffe439..e86e89ad058 100644
--- a/spec/features/error_tracking/user_sees_error_index_spec.rb
+++ b/spec/features/error_tracking/user_sees_error_index_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'View error index page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline,
-feature_category: :error_tracking do
+ feature_category: :error_tracking do
include_context 'sentry error tracking context feature'
let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') }
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb
index de4b9964b98..67133b1856f 100644
--- a/spec/features/groups_spec.rb
+++ b/spec/features/groups_spec.rb
@@ -461,9 +461,11 @@ RSpec.describe 'Group', feature_category: :groups_and_projects do
describe 'new subgroup / project button' do
let_it_be(:group, reload: true) do
- create(:group,
- project_creation_level: Gitlab::Access::NO_ONE_PROJECT_ACCESS,
- subgroup_creation_level: Gitlab::Access::OWNER_SUBGROUP_ACCESS)
+ create(
+ :group,
+ project_creation_level: Gitlab::Access::NO_ONE_PROJECT_ACCESS,
+ subgroup_creation_level: Gitlab::Access::OWNER_SUBGROUP_ACCESS
+ )
end
before do
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb
index 905c5e25f6e..627326dde18 100644
--- a/spec/features/help_pages_spec.rb
+++ b/spec/features/help_pages_spec.rb
@@ -47,9 +47,11 @@ RSpec.describe 'Help Pages', feature_category: :shared do
describe 'when help page is customized' do
before do
- stub_application_setting(help_page_hide_commercial_content: true,
- help_page_text: 'My Custom Text',
- help_page_support_url: 'http://example.com/help')
+ stub_application_setting(
+ help_page_hide_commercial_content: true,
+ help_page_text: 'My Custom Text',
+ help_page_support_url: 'http://example.com/help'
+ )
sign_in(create(:user))
visit help_path
diff --git a/spec/features/ics/dashboard_issues_spec.rb b/spec/features/ics/dashboard_issues_spec.rb
index 7115bd7dff7..00318f83105 100644
--- a/spec/features/ics/dashboard_issues_spec.rb
+++ b/spec/features/ics/dashboard_issues_spec.rb
@@ -29,9 +29,11 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin
context 'with no referer' do
it 'renders calendar feed' do
sign_in user
- visit issues_dashboard_path(:ics,
- due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
- sort: 'closest_future_date')
+ visit issues_dashboard_path(
+ :ics,
+ due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
+ sort: 'closest_future_date'
+ )
expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(body).to have_text('BEGIN:VCALENDAR')
@@ -42,9 +44,11 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin
it 'renders calendar feed as text/plain' do
sign_in user
page.driver.header('Referer', issues_dashboard_url(host: Settings.gitlab.base_url))
- visit issues_dashboard_path(:ics,
- due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
- sort: 'closest_future_date')
+ visit issues_dashboard_path(
+ :ics,
+ due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
+ sort: 'closest_future_date'
+ )
expect(response_headers['Content-Type']).to have_content('text/plain')
expect(body).to have_text('BEGIN:VCALENDAR')
@@ -54,10 +58,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin
context 'when filtered by milestone' do
it 'renders calendar feed' do
sign_in user
- visit issues_dashboard_path(:ics,
- due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
- sort: 'closest_future_date',
- milestone_title: milestone.title)
+ visit issues_dashboard_path(
+ :ics,
+ due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
+ sort: 'closest_future_date',
+ milestone_title: milestone.title
+ )
expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(body).to have_text('BEGIN:VCALENDAR')
@@ -69,10 +75,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin
it 'renders calendar feed' do
personal_access_token = create(:personal_access_token, user: user)
- visit issues_dashboard_path(:ics,
- due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
- sort: 'closest_future_date',
- private_token: personal_access_token.token)
+ visit issues_dashboard_path(
+ :ics,
+ due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
+ sort: 'closest_future_date',
+ private_token: personal_access_token.token
+ )
expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(body).to have_text('BEGIN:VCALENDAR')
@@ -81,10 +89,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin
context 'when authenticated via feed token' do
it 'renders calendar feed' do
- visit issues_dashboard_path(:ics,
- due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
- sort: 'closest_future_date',
- feed_token: user.feed_token)
+ visit issues_dashboard_path(
+ :ics,
+ due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
+ sort: 'closest_future_date',
+ feed_token: user.feed_token
+ )
expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(body).to have_text('BEGIN:VCALENDAR')
@@ -93,15 +103,24 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin
context 'issue with due date' do
let!(:issue) do
- create(:issue, author: user, assignees: [assignee], project: project, title: 'test title',
- description: 'test desc', due_date: Date.tomorrow)
+ create(
+ :issue,
+ author: user,
+ assignees: [assignee],
+ project: project,
+ title: 'test title',
+ description: 'test desc',
+ due_date: Date.tomorrow
+ )
end
it 'renders issue fields' do
- visit issues_dashboard_path(:ics,
- due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
- sort: 'closest_future_date',
- feed_token: user.feed_token)
+ visit issues_dashboard_path(
+ :ics,
+ due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name,
+ sort: 'closest_future_date',
+ feed_token: user.feed_token
+ )
expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
# line length for ics is 75 chars
diff --git a/spec/features/ics/group_issues_spec.rb b/spec/features/ics/group_issues_spec.rb
index 164f5df7cc5..ce9f5638a00 100644
--- a/spec/features/ics/group_issues_spec.rb
+++ b/spec/features/ics/group_issues_spec.rb
@@ -71,8 +71,15 @@ RSpec.describe 'Group Issues Calendar Feed', feature_category: :groups_and_proje
context 'issue with due date' do
let!(:issue) do
- create(:issue, author: user, assignees: [assignee], project: project, title: 'test title',
- description: 'test desc', due_date: Date.tomorrow)
+ create(
+ :issue,
+ author: user,
+ assignees: [assignee],
+ project: project,
+ title: 'test title',
+ description: 'test desc',
+ due_date: Date.tomorrow
+ )
end
it 'renders issue fields' do
diff --git a/spec/features/ics/project_issues_spec.rb b/spec/features/ics/project_issues_spec.rb
index daad6f1df2f..c26147e0310 100644
--- a/spec/features/ics/project_issues_spec.rb
+++ b/spec/features/ics/project_issues_spec.rb
@@ -70,8 +70,15 @@ RSpec.describe 'Project Issues Calendar Feed', feature_category: :groups_and_pro
context 'issue with due date' do
let!(:issue) do
- create(:issue, author: user, assignees: [assignee], project: project, title: 'test title',
- description: 'test desc', due_date: Date.tomorrow)
+ create(
+ :issue,
+ author: user,
+ assignees: [assignee],
+ project: project,
+ title: 'test title',
+ description: 'test desc',
+ due_date: Date.tomorrow
+ )
end
it 'renders issue fields' do
diff --git a/spec/features/incidents/incident_timeline_events_spec.rb b/spec/features/incidents/incident_timeline_events_spec.rb
index 8829f21cabe..bd3658ab60f 100644
--- a/spec/features/incidents/incident_timeline_events_spec.rb
+++ b/spec/features/incidents/incident_timeline_events_spec.rb
@@ -93,7 +93,7 @@ RSpec.describe 'Incident timeline events', :js, feature_category: :incident_mana
end
it_behaves_like 'for each incident details route',
- 'add, edit, and delete timeline events',
- tab_text: s_('Incident|Timeline'),
- tab: 'timeline'
+ 'add, edit, and delete timeline events',
+ tab_text: s_('Incident|Timeline'),
+ tab: 'timeline'
end
diff --git a/spec/features/incidents/user_views_incident_spec.rb b/spec/features/incidents/user_views_incident_spec.rb
index 8739c99bdd0..bbf579b09a8 100644
--- a/spec/features/incidents/user_views_incident_spec.rb
+++ b/spec/features/incidents/user_views_incident_spec.rb
@@ -31,10 +31,12 @@ RSpec.describe "User views incident", feature_category: :incident_management do
describe 'user actions' do
it 'shows the merge request and incident actions', :js, :aggregate_failures do
- expected_href = new_project_issue_path(project,
- issuable_template: 'incident',
- issue: { issue_type: 'incident' },
- add_related_issue: incident.iid)
+ expected_href = new_project_issue_path(
+ project,
+ issuable_template: 'incident',
+ issue: { issue_type: 'incident' },
+ add_related_issue: incident.iid
+ )
click_button 'Incident actions'
diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb
index c979aff2147..7bf9620f282 100644
--- a/spec/features/issuables/issuable_list_spec.rb
+++ b/spec/features/issuables/issuable_list_spec.rb
@@ -99,9 +99,7 @@ RSpec.describe 'issuable list', :js, feature_category: :team_planning do
if issuable_type == :issue
issue = Issue.reorder(:iid).first
- merge_request = create(:merge_request,
- source_project: project,
- source_branch: generate(:branch))
+ merge_request = create(:merge_request, source_project: project, source_branch: generate(:branch))
create(:merge_requests_closing_issues, issue: issue, merge_request: merge_request)
end
diff --git a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb
index 3a32bd34af8..73a920421a3 100644
--- a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb
+++ b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb
@@ -74,8 +74,11 @@ RSpec.describe 'Resolve an open thread in a merge request by creating an issue',
before do
project.add_reporter(user)
sign_in user
- visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid,
- discussion_to_resolve: discussion.id)
+ visit new_project_issue_path(
+ project,
+ merge_request_to_resolve_discussions_of: merge_request.iid,
+ discussion_to_resolve: discussion.id
+ )
end
it 'shows a notice to ask someone else to resolve the threads' do
diff --git a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb
index 1050bc2456f..ecb899a7ca2 100644
--- a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb
+++ b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb
@@ -137,13 +137,25 @@ RSpec.describe 'User creates branch and merge request on issue page', :js, featu
context "when there is a referenced merge request" do
let!(:note) do
- create(:note, :on_issue, :system, project: project, noteable: issue,
- note: "mentioned in #{referenced_mr.to_reference}")
+ create(
+ :note,
+ :on_issue,
+ :system,
+ project: project,
+ noteable: issue,
+ note: "mentioned in #{referenced_mr.to_reference}"
+ )
end
let(:referenced_mr) do
- create(:merge_request, :simple, source_project: project, target_project: project,
- description: "Fixes #{issue.to_reference}", author: user)
+ create(
+ :merge_request,
+ :simple,
+ source_project: project,
+ target_project: project,
+ description: "Fixes #{issue.to_reference}",
+ author: user
+ )
end
before do
diff --git a/spec/features/issues/user_filters_issues_spec.rb b/spec/features/issues/user_filters_issues_spec.rb
index 9f69e94b86c..593b43698a2 100644
--- a/spec/features/issues/user_filters_issues_spec.rb
+++ b/spec/features/issues/user_filters_issues_spec.rb
@@ -8,11 +8,13 @@ RSpec.describe 'User filters issues', :js, feature_category: :team_planning do
before do
%w[foobar barbaz].each do |title|
- create(:issue,
- author: user,
- assignees: [user],
- project: project,
- title: title)
+ create(
+ :issue,
+ author: user,
+ assignees: [user],
+ project: project,
+ title: title
+ )
end
@issue = Issue.find_by(title: 'foobar')
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index 0340c7db75d..ab3a7dbb500 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -808,6 +808,7 @@ project:
- design_management_repository
- design_management_repository_state
- compliance_standards_adherence
+- scan_result_policy_reads
award_emoji:
- awardable
- user
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
index 08de31c3e2d..26bbe305dc5 100644
--- a/spec/models/application_setting_spec.rb
+++ b/spec/models/application_setting_spec.rb
@@ -59,8 +59,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do
it { is_expected.to allow_value("dev.gitlab.com").for(:commit_email_hostname) }
it { is_expected.not_to allow_value("@dev.gitlab").for(:commit_email_hostname) }
- it { is_expected.to allow_value(true).for(:container_expiration_policies_enable_historic_entries) }
- it { is_expected.to allow_value(false).for(:container_expiration_policies_enable_historic_entries) }
+ it { is_expected.to allow_value(true, false).for(:container_expiration_policies_enable_historic_entries) }
it { is_expected.not_to allow_value(nil).for(:container_expiration_policies_enable_historic_entries) }
it { is_expected.to allow_value("myemail@gitlab.com").for(:lets_encrypt_notification_email) }
@@ -100,8 +99,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do
it { is_expected.to validate_numericality_of(:container_registry_cleanup_tags_service_max_list_size).only_integer.is_greater_than_or_equal_to(0) }
it { is_expected.to validate_numericality_of(:container_registry_data_repair_detail_worker_max_concurrency).only_integer.is_greater_than_or_equal_to(0) }
it { is_expected.to validate_numericality_of(:container_registry_expiration_policies_worker_capacity).only_integer.is_greater_than_or_equal_to(0) }
- it { is_expected.to allow_value(true).for(:container_registry_expiration_policies_caching) }
- it { is_expected.to allow_value(false).for(:container_registry_expiration_policies_caching) }
+ it { is_expected.to allow_value(true, false).for(:container_registry_expiration_policies_caching) }
it { is_expected.to validate_numericality_of(:container_registry_import_max_tags_count).only_integer.is_greater_than_or_equal_to(0) }
it { is_expected.to validate_numericality_of(:container_registry_import_max_retries).only_integer.is_greater_than_or_equal_to(0) }
@@ -134,8 +132,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do
it { is_expected.to validate_numericality_of(:snippet_size_limit).only_integer.is_greater_than(0) }
it { is_expected.to validate_numericality_of(:wiki_page_max_content_bytes).only_integer.is_greater_than_or_equal_to(1024) }
- it { is_expected.to allow_value(true).for(:wiki_asciidoc_allow_uri_includes) }
- it { is_expected.to allow_value(false).for(:wiki_asciidoc_allow_uri_includes) }
+ it { is_expected.to allow_value(true, false).for(:wiki_asciidoc_allow_uri_includes) }
it { is_expected.not_to allow_value(nil).for(:wiki_asciidoc_allow_uri_includes) }
it { is_expected.to validate_presence_of(:max_artifacts_size) }
it { is_expected.to validate_numericality_of(:max_artifacts_size).only_integer.is_greater_than(0) }
@@ -148,8 +145,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do
it { is_expected.to validate_presence_of(:max_terraform_state_size_bytes) }
it { is_expected.to validate_numericality_of(:max_terraform_state_size_bytes).only_integer.is_greater_than_or_equal_to(0) }
- it { is_expected.to allow_value(true).for(:user_defaults_to_private_profile) }
- it { is_expected.to allow_value(false).for(:user_defaults_to_private_profile) }
+ it { is_expected.to allow_value(true, false).for(:user_defaults_to_private_profile) }
it { is_expected.not_to allow_value(nil).for(:user_defaults_to_private_profile) }
it { is_expected.to allow_values([true, false]).for(:deny_all_requests_except_allowed) }
@@ -250,16 +246,13 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do
it { is_expected.to allow_value(http).for(:jira_connect_proxy_url) }
it { is_expected.to allow_value(https).for(:jira_connect_proxy_url) }
- it { is_expected.to allow_value(true).for(:bulk_import_enabled) }
- it { is_expected.to allow_value(false).for(:bulk_import_enabled) }
+ it { is_expected.to allow_value(true, false).for(:bulk_import_enabled) }
it { is_expected.not_to allow_value(nil).for(:bulk_import_enabled) }
- it { is_expected.to allow_value(true).for(:allow_runner_registration_token) }
- it { is_expected.to allow_value(false).for(:allow_runner_registration_token) }
+ it { is_expected.to allow_value(true, false).for(:allow_runner_registration_token) }
it { is_expected.not_to allow_value(nil).for(:allow_runner_registration_token) }
- it { is_expected.to allow_value(true).for(:gitlab_dedicated_instance) }
- it { is_expected.to allow_value(false).for(:gitlab_dedicated_instance) }
+ it { is_expected.to allow_value(true, false).for(:gitlab_dedicated_instance) }
it { is_expected.not_to allow_value(nil).for(:gitlab_dedicated_instance) }
it { is_expected.not_to allow_value(random: :value).for(:database_apdex_settings) }