diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-06 09:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-06 09:09:15 +0300 |
commit | 760ddae438828cf73c61f2ca1f4e1f4b9c1d5d2f (patch) | |
tree | 023aaff89705b8c85d67958d3aef75c2540a94af /spec | |
parent | e6f1de5a8fc0a18647d4ff8cff0a50988dcb8e99 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
55 files changed, 173 insertions, 173 deletions
diff --git a/spec/benchmarks/banzai_benchmark.rb b/spec/benchmarks/banzai_benchmark.rb index 45f45bcc8dd..988577691f2 100644 --- a/spec/benchmarks/banzai_benchmark.rb +++ b/spec/benchmarks/banzai_benchmark.rb @@ -52,7 +52,7 @@ RSpec.describe 'GitLab Markdown Benchmark', :aggregate_failures, feature_categor stub_application_setting(asset_proxy_enabled: true) stub_application_setting(asset_proxy_secret_key: 'shared-secret') stub_application_setting(asset_proxy_url: 'https://assets.example.com') - stub_application_setting(asset_proxy_whitelist: %w(gitlab.com *.mydomain.com)) + stub_application_setting(asset_proxy_whitelist: %w[gitlab.com *.mydomain.com]) stub_application_setting(plantuml_enabled: true, plantuml_url: 'http://localhost:8080') stub_application_setting(kroki_enabled: true, kroki_url: 'http://localhost:8000') diff --git a/spec/commands/sidekiq_cluster/cli_spec.rb b/spec/commands/sidekiq_cluster/cli_spec.rb index 09e40d8f91a..d5fa88e72a7 100644 --- a/spec/commands/sidekiq_cluster/cli_spec.rb +++ b/spec/commands/sidekiq_cluster/cli_spec.rb @@ -63,11 +63,11 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ .with([['foo'] + described_class::DEFAULT_QUEUES], default_options) .and_return([]) - cli.run(%w(foo)) + cli.run(%w[foo]) end it 'allows the special * selector' do - worker_queues = %w(foo bar baz) + worker_queues = %w[foo bar baz] expect(Gitlab::SidekiqConfig::CliMethods) .to receive(:worker_queues).and_return(worker_queues) @@ -75,7 +75,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(Gitlab::SidekiqCluster) .to receive(:start).with([worker_queues], default_options).and_return([]) - cli.run(%w(*)) + cli.run(%w[*]) end it 'raises an error when the arguments contain newlines' do @@ -97,31 +97,31 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ .with([['baz'] + described_class::DEFAULT_QUEUES], default_options) .and_return([]) - cli.run(%w(foo -n)) + cli.run(%w[foo -n]) end end context 'with --max-concurrency flag' do it 'starts Sidekiq workers for specified queues with a max concurrency' do - expected_queues = [%w(foo bar baz), %w(solo)].each { |queues| queues.concat(described_class::DEFAULT_QUEUES) } - expect(Gitlab::SidekiqConfig::CliMethods).to receive(:worker_queues).and_return(%w(foo bar baz)) + expected_queues = [%w[foo bar baz], %w[solo]].each { |queues| queues.concat(described_class::DEFAULT_QUEUES) } + expect(Gitlab::SidekiqConfig::CliMethods).to receive(:worker_queues).and_return(%w[foo bar baz]) expect(Gitlab::SidekiqCluster).to receive(:start) .with(expected_queues, default_options.merge(max_concurrency: 2)) .and_return([]) - cli.run(%w(foo,bar,baz solo -m 2)) + cli.run(%w[foo,bar,baz solo -m 2]) end end context 'with --min-concurrency flag' do it 'starts Sidekiq workers for specified queues with a min concurrency' do - expected_queues = [%w(foo bar baz), %w(solo)].each { |queues| queues.concat(described_class::DEFAULT_QUEUES) } - expect(Gitlab::SidekiqConfig::CliMethods).to receive(:worker_queues).and_return(%w(foo bar baz)) + expected_queues = [%w[foo bar baz], %w[solo]].each { |queues| queues.concat(described_class::DEFAULT_QUEUES) } + expect(Gitlab::SidekiqConfig::CliMethods).to receive(:worker_queues).and_return(%w[foo bar baz]) expect(Gitlab::SidekiqCluster).to receive(:start) .with(expected_queues, default_options.merge(min_concurrency: 2)) .and_return([]) - cli.run(%w(foo,bar,baz solo --min-concurrency 2)) + cli.run(%w[foo,bar,baz solo --min-concurrency 2]) end end @@ -131,7 +131,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ .with([['foo'] + described_class::DEFAULT_QUEUES], default_options.merge(timeout: 10)) .and_return([]) - cli.run(%w(foo --timeout 10)) + cli.run(%w[foo --timeout 10]) end it 'when not given', 'starts Sidekiq workers with default timeout' do @@ -140,13 +140,13 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ Gitlab::SidekiqCluster::DEFAULT_SOFT_TIMEOUT_SECONDS)) .and_return([]) - cli.run(%w(foo)) + cli.run(%w[foo]) end end context 'with --list-queues flag' do it 'errors when given --list-queues and --dryrun' do - expect { cli.run(%w(foo --list-queues --dryrun)) }.to raise_error(described_class::CommandError) + expect { cli.run(%w[foo --list-queues --dryrun]) }.to raise_error(described_class::CommandError) end it 'prints out a list of queues in alphabetical order' do @@ -163,7 +163,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(cli).to receive(:puts).with([expected_queues]) - cli.run(%w(--queue-selector feature_category=epics --list-queues)) + cli.run(%w[--queue-selector feature_category=epics --list-queues]) end end @@ -175,7 +175,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ described_class::DEFAULT_QUEUES], default_options) .and_return([]) - cli.run(%w(cronjob)) + cli.run(%w[cronjob]) end end @@ -184,33 +184,33 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ { 'memory-bound queues' => { query: 'resource_boundary=memory', - included_queues: %w(project_export), - excluded_queues: %w(merge) + included_queues: %w[project_export], + excluded_queues: %w[merge] }, 'memory- or CPU-bound queues' => { query: 'resource_boundary=memory,cpu', - included_queues: %w(auto_merge:auto_merge_process project_export), - excluded_queues: %w(merge) + included_queues: %w[auto_merge:auto_merge_process project_export], + excluded_queues: %w[merge] }, 'high urgency CI queues' => { query: 'feature_category=continuous_integration&urgency=high', - included_queues: %w(pipeline_default:ci_drop_pipeline), - excluded_queues: %w(merge) + included_queues: %w[pipeline_default:ci_drop_pipeline], + excluded_queues: %w[merge] }, 'CPU-bound high urgency CI queues' => { query: 'feature_category=continuous_integration&urgency=high&resource_boundary=cpu', - included_queues: %w(pipeline_default:ci_create_downstream_pipeline), - excluded_queues: %w(pipeline_default:ci_drop_pipeline merge) + included_queues: %w[pipeline_default:ci_create_downstream_pipeline], + excluded_queues: %w[pipeline_default:ci_drop_pipeline merge] }, 'CPU-bound high urgency non-CI queues' => { query: 'feature_category!=continuous_integration&urgency=high&resource_boundary=cpu', - included_queues: %w(new_issue), - excluded_queues: %w(pipeline_default:ci_create_downstream_pipeline) + included_queues: %w[new_issue], + excluded_queues: %w[pipeline_default:ci_create_downstream_pipeline] }, 'CI and SCM queues' => { query: 'feature_category=continuous_integration|feature_category=source_code_management', - included_queues: %w(pipeline_default:ci_drop_pipeline merge), - excluded_queues: %w() + included_queues: %w[pipeline_default:ci_drop_pipeline merge], + excluded_queues: %w[] } } end @@ -226,7 +226,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ [] end - cli.run(%W(--queue-selector #{query})) + cli.run(%W[--queue-selector #{query}]) end it 'works when negated' do @@ -239,7 +239,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ [] end - cli.run(%W(--negate --queue-selector #{query})) + cli.run(%W[--negate --queue-selector #{query}]) end end @@ -264,11 +264,11 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ .with(expected_workers, default_options) .and_return([]) - cli.run(%w(--queue-selector feature_category=incident_management&has_external_dependencies=true resource_boundary=memory&feature_category=importers)) + cli.run(%w[--queue-selector feature_category=incident_management&has_external_dependencies=true resource_boundary=memory&feature_category=importers]) end it 'allows the special * selector' do - worker_queues = %w(foo bar baz) + worker_queues = %w[foo bar baz] expect(Gitlab::SidekiqConfig::CliMethods) .to receive(:worker_queues).and_return(worker_queues) @@ -276,20 +276,20 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(Gitlab::SidekiqCluster) .to receive(:start).with([worker_queues], default_options).and_return([]) - cli.run(%w(--queue-selector *)) + cli.run(%w[--queue-selector *]) end it 'errors when the selector matches no queues' do expect(Gitlab::SidekiqCluster).not_to receive(:start) - expect { cli.run(%w(--queue-selector has_external_dependencies=true&has_external_dependencies=false)) } + expect { cli.run(%w[--queue-selector has_external_dependencies=true&has_external_dependencies=false]) } .to raise_error(described_class::CommandError) end it 'errors on an invalid query multiple queue groups correctly' do expect(Gitlab::SidekiqCluster).not_to receive(:start) - expect { cli.run(%w(--queue-selector unknown_field=chatops)) } + expect { cli.run(%w[--queue-selector unknown_field=chatops]) } .to raise_error(Gitlab::SidekiqConfig::WorkerMatcher::QueryError) end end @@ -304,7 +304,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ .with([['foo']], default_options) .and_return([]) - cli.run(%w(foo)) + cli.run(%w[foo]) end end @@ -316,7 +316,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it "does not throw an error" do allow(Gitlab::SidekiqCluster).to receive(:start).and_return([]) - expect { cli.run(%w(foo)) }.not_to raise_error + expect { cli.run(%w[foo]) }.not_to raise_error end it "starts Sidekiq workers with given queues, and additional default and mailers queues (DEFAULT_QUEUES)" do @@ -324,7 +324,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ .with([['foo'] + described_class::DEFAULT_QUEUES], default_options) .and_return([]) - cli.run(%w(foo)) + cli.run(%w[foo]) end end end @@ -351,7 +351,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(metrics_cleanup_service).to receive(:execute).ordered expect(Gitlab::SidekiqCluster).to receive(:start).ordered.and_return([]) - cli.run(%w(foo)) + cli.run(%w[foo]) end context 'when sidekiq_exporter is not set up' do @@ -362,7 +362,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'does not start a sidekiq metrics server' do expect(MetricsServer).not_to receive(:start_for_sidekiq) - cli.run(%w(foo)) + cli.run(%w[foo]) end end @@ -374,11 +374,11 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'does not start a sidekiq metrics server' do expect(MetricsServer).not_to receive(:start_for_sidekiq) - cli.run(%w(foo)) + cli.run(%w[foo]) end it 'does not throw an error' do - expect { cli.run(%w(foo)) }.not_to raise_error + expect { cli.run(%w[foo]) }.not_to raise_error end end @@ -386,7 +386,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'does not start a sidekiq metrics server' do expect(MetricsServer).not_to receive(:start_for_sidekiq) - cli.run(%w(foo)) + cli.run(%w[foo]) end end @@ -396,7 +396,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'starts the metrics server' do expect(MetricsServer).to receive(:start_for_sidekiq).with(metrics_dir: metrics_dir, reset_signals: trapped_signals) - cli.run(%w(foo)) + cli.run(%w[foo]) end end @@ -404,8 +404,8 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'writes the PID to a file' do expect(Gitlab::ProcessManagement).to receive(:write_pid).with('/dev/null') - cli.option_parser.parse!(%w(-P /dev/null)) - cli.run(%w(foo)) + cli.option_parser.parse!(%w[-P /dev/null]) + cli.run(%w[foo]) end end @@ -413,7 +413,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'does not write a PID' do expect(Gitlab::ProcessManagement).not_to receive(:write_pid) - cli.run(%w(foo)) + cli.run(%w[foo]) end end end @@ -424,7 +424,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ it 'does not start the server' do expect(MetricsServer).not_to receive(:start_for_sidekiq) - cli.run(%w(foo --dryrun)) + cli.run(%w[foo --dryrun]) end end end @@ -456,7 +456,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(supervisor).to receive(:shutdown) expect(cli).not_to receive(:exit).with(1) - cli.run(%w(foo)) + cli.run(%w[foo]) end end @@ -468,7 +468,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(process_status).to receive(:success?).and_return(false) expect(cli).to receive(:exit).with(1) - cli.run(%w(foo)) + cli.run(%w[foo]) end end @@ -477,14 +477,14 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, feature_category: :gitlab_cli, stub_ expect(supervisor).to receive(:supervise).and_yield([2, 99]) expect(supervisor).to receive(:shutdown) - cli.run(%w(foo)) + cli.run(%w[foo]) end it 'restarts the metrics server when it is down' do expect(supervisor).to receive(:supervise).and_yield([metrics_server_pid]) expect(MetricsServer).to receive(:start_for_sidekiq).twice.and_return(metrics_server_pid) - cli.run(%w(foo)) + cli.run(%w[foo]) end end end diff --git a/spec/components/pajamas/component_spec.rb b/spec/components/pajamas/component_spec.rb index 7385519b468..d5c7a0e2538 100644 --- a/spec/components/pajamas/component_spec.rb +++ b/spec/components/pajamas/component_spec.rb @@ -30,7 +30,7 @@ RSpec.describe Pajamas::Component do subject.send( :format_options, options: { foo: 'bar', class: 'gl-display-flex gl-py-5' }, - css_classes: %w(gl-px-5 gl-mt-5), + css_classes: %w[gl-px-5 gl-mt-5], additional_options: { baz: 'bax' } ) ).to match({ diff --git a/spec/controllers/concerns/continue_params_spec.rb b/spec/controllers/concerns/continue_params_spec.rb index 9ac7087430e..a9899447054 100644 --- a/spec/controllers/concerns/continue_params_spec.rb +++ b/spec/controllers/concerns/continue_params_spec.rb @@ -34,7 +34,7 @@ RSpec.describe ContinueParams do strong_continue_params(to: '/hello', notice: 'world', notice_now: '!', something: 'else') end - expect(controller.continue_params.keys).to contain_exactly(*%w(to notice notice_now)) + expect(controller.continue_params.keys).to contain_exactly(*%w[to notice notice_now]) end it 'does not allow cross host redirection' do diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb index 5c162d7d59e..bc73168ff1a 100644 --- a/spec/controllers/graphql_controller_spec.rb +++ b/spec/controllers/graphql_controller_spec.rb @@ -628,7 +628,7 @@ RSpec.describe GraphqlController, feature_category: :integrations do let_it_be(:admin) { create(:admin) } let_it_be(:project) { create(:project) } - let(:graphql_query) { graphql_query_for('project', { 'fullPath' => project.full_path }, %w(id name)) } + let(:graphql_query) { graphql_query_for('project', { 'fullPath' => project.full_path }, %w[id name]) } before do sign_in(admin) @@ -674,8 +674,8 @@ RSpec.describe GraphqlController, feature_category: :integrations do end describe '#append_info_to_payload' do - let(:query_1) { { query: graphql_query_for('project', { 'fullPath' => 'foo' }, %w(id name), 'getProject_1') } } - let(:query_2) { { query: graphql_query_for('project', { 'fullPath' => 'bar' }, %w(id), 'getProject_2') } } + let(:query_1) { { query: graphql_query_for('project', { 'fullPath' => 'foo' }, %w[id name], 'getProject_1') } } + let(:query_2) { { query: graphql_query_for('project', { 'fullPath' => 'bar' }, %w[id], 'getProject_2') } } let(:graphql_queries) { [query_1, query_2] } let(:log_payload) { {} } let(:expected_logs) do diff --git a/spec/controllers/groups/releases_controller_spec.rb b/spec/controllers/groups/releases_controller_spec.rb index 40e8cb4efc5..4b4333dea0e 100644 --- a/spec/controllers/groups/releases_controller_spec.rb +++ b/spec/controllers/groups/releases_controller_spec.rb @@ -56,7 +56,7 @@ RSpec.describe Groups::ReleasesController do index - expect(json_response.map { |r| r['tag'] }).to match_array(%w(p2 p1 v2 v1)) + expect(json_response.map { |r| r['tag'] }).to match_array(%w[p2 p1 v2 v1]) end end diff --git a/spec/controllers/jira_connect/app_descriptor_controller_spec.rb b/spec/controllers/jira_connect/app_descriptor_controller_spec.rb index 48b315646de..ea6cb688409 100644 --- a/spec/controllers/jira_connect/app_descriptor_controller_spec.rb +++ b/spec/controllers/jira_connect/app_descriptor_controller_spec.rb @@ -42,7 +42,7 @@ RSpec.describe JiraConnect::AppDescriptorController, feature_category: :integrat authentication: { type: 'jwt' }, - scopes: %w(READ WRITE DELETE), + scopes: %w[READ WRITE DELETE], apiVersion: 1, apiMigrations: { 'context-qsh': true, @@ -71,7 +71,7 @@ RSpec.describe JiraConnect::AppDescriptorController, feature_category: :integrat name: { value: 'GitLab' }, url: 'https://gitlab.com', logoUrl: logo_url, - capabilities: %w(branch commit pull_request) + capabilities: %w[branch commit pull_request] }, jiraBuildInfoProvider: common_module_properties.merge( actions: {}, diff --git a/spec/controllers/oauth/applications_controller_spec.rb b/spec/controllers/oauth/applications_controller_spec.rb index 44deeb6c47e..dcd817861a7 100644 --- a/spec/controllers/oauth/applications_controller_spec.rb +++ b/spec/controllers/oauth/applications_controller_spec.rb @@ -198,7 +198,7 @@ RSpec.describe Oauth::ApplicationsController, feature_category: :system_access d end context 'when scopes are invalid' do - let(:scopes) { %w(api foo) } + let(:scopes) { %w[api foo] } render_views diff --git a/spec/controllers/profiles/two_factor_auths_controller_spec.rb b/spec/controllers/profiles/two_factor_auths_controller_spec.rb index dde0af3c543..0c4280467f4 100644 --- a/spec/controllers/profiles/two_factor_auths_controller_spec.rb +++ b/spec/controllers/profiles/two_factor_auths_controller_spec.rb @@ -165,11 +165,11 @@ RSpec.describe Profiles::TwoFactorAuthsController, feature_category: :system_acc end it 'presents plaintext codes for the user to save' do - expect(user).to receive(:generate_otp_backup_codes!).and_return(%w(a b c)) + expect(user).to receive(:generate_otp_backup_codes!).and_return(%w[a b c]) go - expect(assigns[:codes]).to match_array %w(a b c) + expect(assigns[:codes]).to match_array %w[a b c] end it 'calls to delete other sessions' do @@ -216,11 +216,11 @@ RSpec.describe Profiles::TwoFactorAuthsController, feature_category: :system_acc end it 'presents plaintext codes for the user to save' do - expect(user).to receive(:generate_otp_backup_codes!).and_return(%w(a b c)) + expect(user).to receive(:generate_otp_backup_codes!).and_return(%w[a b c]) go - expect(assigns[:codes]).to match_array %w(a b c) + expect(assigns[:codes]).to match_array %w[a b c] end it 'calls to delete other sessions' do @@ -288,10 +288,10 @@ RSpec.describe Profiles::TwoFactorAuthsController, feature_category: :system_acc let(:current_password) { user.password } it 'presents plaintext codes for the user to save' do - expect(user).to receive(:generate_otp_backup_codes!).and_return(%w(a b c)) + expect(user).to receive(:generate_otp_backup_codes!).and_return(%w[a b c]) post :codes, params: { current_password: current_password } - expect(assigns[:codes]).to match_array %w(a b c) + expect(assigns[:codes]).to match_array %w[a b c] end it 'persists the generated codes' do diff --git a/spec/controllers/projects/artifacts_controller_spec.rb b/spec/controllers/projects/artifacts_controller_spec.rb index 44615506e5d..31e6d6ae5e6 100644 --- a/spec/controllers/projects/artifacts_controller_spec.rb +++ b/spec/controllers/projects/artifacts_controller_spec.rb @@ -409,7 +409,7 @@ RSpec.describe Projects::ArtifactsController, feature_category: :build_artifacts expect(response.headers['Gitlab-Workhorse-Detect-Content-Type']).to eq('true') expect(send_data).to start_with('artifacts-entry:') - expect(params.keys).to eq(%w(Archive Entry)) + expect(params.keys).to eq(%w[Archive Entry]) expect(params['Archive']).to start_with(archive_path) # On object storage, the URL can end with a query string expect(params['Archive']).to match(archive_matcher) diff --git a/spec/controllers/projects/deploy_keys_controller_spec.rb b/spec/controllers/projects/deploy_keys_controller_spec.rb index 52a605cf548..96addb4b6c5 100644 --- a/spec/controllers/projects/deploy_keys_controller_spec.rb +++ b/spec/controllers/projects/deploy_keys_controller_spec.rb @@ -54,7 +54,7 @@ RSpec.describe Projects::DeployKeysController do it 'returns json in a correct format' do get :index, params: params.merge(format: :json) - expect(json_response.keys).to match_array(%w(enabled_keys available_project_keys public_keys)) + expect(json_response.keys).to match_array(%w[enabled_keys available_project_keys public_keys]) expect(json_response['enabled_keys'].count).to eq(1) expect(json_response['available_project_keys'].count).to eq(1) expect(json_response['public_keys'].count).to eq(1) diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index d4f04105605..96840e09ccf 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -849,7 +849,7 @@ RSpec.describe Projects::IssuesController, :request_store, feature_category: :te update_issue(issue_params: { assignee_ids: [assignee.id] }) expect(json_response['assignees'].first.keys) - .to include(*%w(id name username avatar_url state web_url)) + .to include(*%w[id name username avatar_url state web_url]) end end diff --git a/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb b/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb index 428ce5b5607..1fe297362bf 100644 --- a/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb @@ -97,7 +97,7 @@ RSpec.describe Projects::MergeRequests::ConflictsController, feature_category: : section['lines'].each do |line| if section['conflict'] - expect(line['type']).to be_in(%w(old new)) + expect(line['type']).to be_in(%w[old new]) expect(line.values_at('old_line', 'new_line')).to contain_exactly(nil, a_kind_of(Integer)) elsif line['type'].nil? expect(line['old_line']).not_to eq(nil) diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index a47bb98770c..92bbffdfde5 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -407,7 +407,7 @@ RSpec.describe Projects::MergeRequestsController, feature_category: :code_review update_merge_request({ assignee_ids: [assignee.id] }, format: :json) - expect(json_response['assignees']).to all(include(*%w(name username avatar_url id state web_url))) + expect(json_response['assignees']).to all(include(*%w[name username avatar_url id state web_url])) end end diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index bd3fc9d9a1f..deaed8e1162 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -216,7 +216,7 @@ RSpec.describe Projects::PipelinesController, feature_category: :continuous_inte end def create_all_pipeline_types - %w(pending running success failed canceled).each_with_index do |status, index| + %w[pending running success failed canceled].each_with_index do |status, index| create_pipeline(status, project.commit("HEAD~#{index}")) end diff --git a/spec/controllers/projects/settings/ci_cd_controller_spec.rb b/spec/controllers/projects/settings/ci_cd_controller_spec.rb index 63c870eb133..b27b4e6fe19 100644 --- a/spec/controllers/projects/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/projects/settings/ci_cd_controller_spec.rb @@ -100,15 +100,15 @@ RSpec.describe Projects::Settings::CiCdController, feature_category: :continuous show # warmup # with one tag - create(:ci_runner, :instance, tag_list: %w(shared_runner)) - create(:ci_runner, :project, projects: [other_project], tag_list: %w(project_runner)) - create(:ci_runner, :group, groups: [group], tag_list: %w(group_runner)) + create(:ci_runner, :instance, tag_list: %w[shared_runner]) + create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner]) + create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner]) control = ActiveRecord::QueryRecorder.new { show } # with several tags - create(:ci_runner, :instance, tag_list: %w(shared_runner tag2 tag3)) - create(:ci_runner, :project, projects: [other_project], tag_list: %w(project_runner tag2 tag3)) - create(:ci_runner, :group, groups: [group], tag_list: %w(group_runner tag2 tag3)) + create(:ci_runner, :instance, tag_list: %w[shared_runner tag2 tag3]) + create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner tag2 tag3]) + create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner tag2 tag3]) expect { show }.not_to exceed_query_limit(control) end diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 7d7bebb7106..dea359e8fee 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -1368,7 +1368,7 @@ RSpec.describe ProjectsController, feature_category: :groups_and_projects do it 'renders json in a correct format' do post :preview_markdown, params: { namespace_id: public_project.namespace, id: public_project, text: '*Markdown* text' } - expect(json_response.keys).to match_array(%w(body references)) + expect(json_response.keys).to match_array(%w[body references]) end context 'when not authorized' do diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 9771141a955..94aedf463e9 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -551,7 +551,7 @@ RSpec.describe SearchController, feature_category: :global_search do expect(payload[:metadata]['meta.search.force_search_results']).to eq('true') expect(payload[:metadata]['meta.search.filters.confidential']).to eq('true') expect(payload[:metadata]['meta.search.filters.state']).to eq('true') - expect(payload[:metadata]['meta.search.project_ids']).to eq(%w(456 789)) + expect(payload[:metadata]['meta.search.project_ids']).to eq(%w[456 789]) expect(payload[:metadata]['meta.search.type']).to eq('basic') expect(payload[:metadata]['meta.search.level']).to eq('global') expect(payload[:metadata]['meta.search.filters.language']).to eq('ruby') @@ -562,7 +562,7 @@ RSpec.describe SearchController, feature_category: :global_search do search: 'hello world', group_id: '123', project_id: '456', - project_ids: %w(456 789), + project_ids: %w[456 789], confidential: true, include_archived: true, state: true, diff --git a/spec/controllers/snippets_controller_spec.rb b/spec/controllers/snippets_controller_spec.rb index 18b2d3b14ec..b33687df2ef 100644 --- a/spec/controllers/snippets_controller_spec.rb +++ b/spec/controllers/snippets_controller_spec.rb @@ -452,7 +452,7 @@ RSpec.describe SnippetsController do post :preview_markdown, params: { id: public_snippet, text: '*Markdown* text' } - expect(json_response.keys).to match_array(%w(body references)) + expect(json_response.keys).to match_array(%w[body references]) end end end diff --git a/spec/experiments/ios_specific_templates_experiment_spec.rb b/spec/experiments/ios_specific_templates_experiment_spec.rb index 4d02381dbde..909ac22b97b 100644 --- a/spec/experiments/ios_specific_templates_experiment_spec.rb +++ b/spec/experiments/ios_specific_templates_experiment_spec.rb @@ -13,7 +13,7 @@ RSpec.describe IosSpecificTemplatesExperiment do let_it_be(:project) { create(:project, :auto_devops_disabled) } let!(:project_setting) { create(:project_setting, project: project, target_platforms: target_platforms) } - let(:target_platforms) { %w(ios) } + let(:target_platforms) { %w[ios] } before do stub_experiments(ios_specific_templates: :candidate) diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index f0b09194047..867db96aaaf 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -441,8 +441,8 @@ FactoryBot.define do services: ['postgres', { name: 'docker:stable-dind', entrypoint: '/bin/sh', command: 'sleep 30', alias: 'docker' }, { name: 'mysql:latest', variables: { MYSQL_ROOT_PASSWORD: 'root123.' } }], - script: %w(echo), - after_script: %w(ls date), + script: %w[echo], + after_script: %w[ls date], hooks: { pre_get_sources_script: ["echo 'hello pre_get_sources_script'"] }, artifacts: { name: 'artifacts_file', diff --git a/spec/factories/ci/runners.rb b/spec/factories/ci/runners.rb index f001cecd28e..2d67a4c0e80 100644 --- a/spec/factories/ci/runners.rb +++ b/spec/factories/ci/runners.rb @@ -83,7 +83,7 @@ FactoryBot.define do trait :tagged_only do run_untagged { false } - tag_list { %w(tag1 tag2) } + tag_list { %w[tag1 tag2] } end trait :locked do diff --git a/spec/factories/clusters/clusters.rb b/spec/factories/clusters/clusters.rb index 2785a8c9946..d1e7a9fac95 100644 --- a/spec/factories/clusters/clusters.rb +++ b/spec/factories/clusters/clusters.rb @@ -83,7 +83,7 @@ FactoryBot.define do end trait :with_installed_prometheus do - integration_prometheus factory: %i(clusters_integrations_prometheus) + integration_prometheus factory: %i[clusters_integrations_prometheus] end trait :with_domain do @@ -92,7 +92,7 @@ FactoryBot.define do trait :with_environments do transient do - environments { %i(staging production) } + environments { %i[staging production] } end cluster_type { Clusters::Cluster.cluster_types[:project_type] } diff --git a/spec/factories/clusters/integrations/prometheus.rb b/spec/factories/clusters/integrations/prometheus.rb index 1f0bb1ed512..5e8e770e0ed 100644 --- a/spec/factories/clusters/integrations/prometheus.rb +++ b/spec/factories/clusters/integrations/prometheus.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :clusters_integrations_prometheus, class: 'Clusters::Integrations::Prometheus' do - cluster factory: %i(cluster provided_by_gcp) + cluster factory: %i[cluster provided_by_gcp] enabled { true } trait :disabled do diff --git a/spec/factories/clusters/providers/aws.rb b/spec/factories/clusters/providers/aws.rb index 497181de89a..b529eea1458 100644 --- a/spec/factories/clusters/providers/aws.rb +++ b/spec/factories/clusters/providers/aws.rb @@ -7,7 +7,7 @@ FactoryBot.define do kubernetes_version { '1.16' } role_arn { 'arn:aws:iam::123456789012:role/role-name' } vpc_id { 'vpc-00000000000000000' } - subnet_ids { %w(subnet-00000000000000000 subnet-11111111111111111) } + subnet_ids { %w[subnet-00000000000000000 subnet-11111111111111111] } security_group_id { 'sg-00000000000000000' } key_name { 'user' } diff --git a/spec/factories/deployments.rb b/spec/factories/deployments.rb index cbecaadff77..7d80ab7b15d 100644 --- a/spec/factories/deployments.rb +++ b/spec/factories/deployments.rb @@ -29,11 +29,11 @@ FactoryBot.define do end trait :on_cluster do - deployment_cluster factory: %i(deployment_cluster provided_by_gcp) + deployment_cluster factory: %i[deployment_cluster provided_by_gcp] end trait :on_cluster_not_managed do - deployment_cluster factory: %i(deployment_cluster not_managed) + deployment_cluster factory: %i[deployment_cluster not_managed] end trait :running do diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index 43dd80187ce..7fbd6c4e235 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -236,7 +236,7 @@ RSpec.describe 'Expand and collapse diffs', :js, feature_category: :source_code_ expect(page).to have_selector('.diff-content', count: 5) expect(page).to have_selector('.diff-collapsed', count: 5) - %w(file-95.txt file-96.txt file-97.txt file-98.txt file-99.txt).each do |filename| + %w[file-95.txt file-96.txt file-97.txt file-98.txt file-99.txt].each do |filename| expect(find("[data-blob-diff-path*='#{filename}']")).to have_selector('.diff-collapsed') end end @@ -252,7 +252,7 @@ RSpec.describe 'Expand and collapse diffs', :js, feature_category: :source_code_ expect(page).to have_selector('.diff-content', count: 6) expect(page).to have_selector('.diff-collapsed', count: 2) - %w(file-4.txt file-5.txt).each do |filename| + %w[file-4.txt file-5.txt].each do |filename| expect(find("[data-blob-diff-path*='#{filename}']")).to have_selector('.diff-collapsed') end end diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index 7bf9620f282..1020ea341ce 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -87,7 +87,7 @@ RSpec.describe 'issuable list', :js, feature_category: :team_planning do else create(:merge_request, source_project: project, source_branch: generate(:branch)) source_branch = FFaker::Lorem.characters(8) - pipeline = create(:ci_empty_pipeline, project: project, ref: source_branch, status: %w(running failed success).sample, sha: 'any') + pipeline = create(:ci_empty_pipeline, project: project, ref: source_branch, status: %w[running failed success].sample, sha: 'any') create(:merge_request, title: FFaker::Lorem.sentence, source_project: project, source_branch: source_branch, head_pipeline: pipeline) end diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb index d35f037247d..4c4a5624d00 100644 --- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb @@ -12,9 +12,9 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j url = new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) if title.empty? - %{a[href="#{url}"]} + %(a[href="#{url}"]) else - %{a[title="#{title}"][href="#{url}"]} + %(a[title="#{title}"][href="#{url}"]) end end diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index a6ed0b52e7d..4a38373db71 100644 --- a/spec/features/issues/move_spec.rb +++ b/spec/features/issues/move_spec.rb @@ -50,7 +50,7 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning expect(page).to have_content("Text with #{cross_reference}#{mr.to_reference}") expect(page).to have_content("moved from #{cross_reference}#{issue.to_reference}") expect(page).to have_content(issue.title) - expect(page).to have_current_path(%r(#{project_path(new_project)})) + expect(page).to have_current_path(%r{#{project_path(new_project)}}) end it 'searching project dropdown', :js do diff --git a/spec/features/issues/resource_label_events_spec.rb b/spec/features/issues/resource_label_events_spec.rb index 531361b19af..f9c1cc0acd4 100644 --- a/spec/features/issues/resource_label_events_spec.rb +++ b/spec/features/issues/resource_label_events_spec.rb @@ -49,7 +49,7 @@ RSpec.describe 'List issue resource label events', :js, feature_category: :team_ end it 'shows add note for newly added labels' do - toggle_labels(%w(foo bar)) + toggle_labels(%w[foo bar]) visit project_issue_path(project, issue) wait_for_requests diff --git a/spec/features/issues/user_bulk_edits_issues_labels_spec.rb b/spec/features/issues/user_bulk_edits_issues_labels_spec.rb index a01ae9ae0c2..f82b18f3dd7 100644 --- a/spec/features/issues/user_bulk_edits_issues_labels_spec.rb +++ b/spec/features/issues/user_bulk_edits_issues_labels_spec.rb @@ -105,7 +105,7 @@ RSpec.describe 'Issues > Labels bulk assignment', feature_category: :team_planni context 'to all issues' do before do check 'Select all' - open_labels_dropdown %w(bug feature) + open_labels_dropdown %w[bug feature] update_issues end @@ -120,7 +120,7 @@ RSpec.describe 'Issues > Labels bulk assignment', feature_category: :team_planni context 'to a issue' do before do check issue1.title - open_labels_dropdown %w(bug feature) + open_labels_dropdown %w[bug feature] update_issues end @@ -162,7 +162,7 @@ RSpec.describe 'Issues > Labels bulk assignment', feature_category: :team_planni enable_bulk_update check 'Select all' - unmark_labels_in_dropdown %w(bug feature) + unmark_labels_in_dropdown %w[bug feature] update_issues end diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index 5fadeb893d0..29b44bf165d 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -84,7 +84,7 @@ RSpec.describe "User creates issue", feature_category: :team_planning do end context "with labels" do - let(:label_titles) { %w(bug feature enhancement) } + let(:label_titles) { %w[bug feature enhancement] } before do label_titles.each do |title| diff --git a/spec/features/markdown/markdown_spec.rb b/spec/features/markdown/markdown_spec.rb index eb86393d59e..34c9219101f 100644 --- a/spec/features/markdown/markdown_spec.rb +++ b/spec/features/markdown/markdown_spec.rb @@ -167,13 +167,13 @@ RSpec.describe 'GitLab Markdown', :aggregate_failures, feature_category: :team_p it 'allows markup inside link elements' do aggregate_failures do expect(doc.at_css('a[href="#link-emphasis"]').to_html) - .to eq_no_sourcepos %{<a href="#link-emphasis"><em>text</em></a>} + .to eq_no_sourcepos %(<a href="#link-emphasis"><em>text</em></a>) expect(doc.at_css('a[href="#link-strong"]').to_html) - .to eq_no_sourcepos %{<a href="#link-strong"><strong>text</strong></a>} + .to eq_no_sourcepos %(<a href="#link-strong"><strong>text</strong></a>) expect(doc.at_css('a[href="#link-code"]').to_html) - .to eq_no_sourcepos %{<a href="#link-code"><code>text</code></a>} + .to eq_no_sourcepos %(<a href="#link-code"><code>text</code></a>) end end end diff --git a/spec/features/merge_request/user_creates_image_diff_notes_spec.rb b/spec/features/merge_request/user_creates_image_diff_notes_spec.rb index 6d3268ffe3a..3ff6fa2040b 100644 --- a/spec/features/merge_request/user_creates_image_diff_notes_spec.rb +++ b/spec/features/merge_request/user_creates_image_diff_notes_spec.rb @@ -72,7 +72,7 @@ RSpec.describe 'Merge request > User creates image diff notes', :js, feature_cat end end - %w(inline parallel).each do |view| + %w[inline parallel].each do |view| context "#{view} view" do let(:position) do build(:image_diff_position, file: path, diff_refs: merge_request.diff_refs) diff --git a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb index 94393ea00e4..98ea72b9569 100644 --- a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb +++ b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb @@ -83,7 +83,7 @@ RSpec.describe 'Merge request > User sees avatars on diff notes', :js, feature_c end end - %w(parallel).each do |view| + %w[parallel].each do |view| context "#{view} view" do before do visit diffs_project_merge_request_path(project, merge_request, view: view) diff --git a/spec/features/projects/active_tabs_spec.rb b/spec/features/projects/active_tabs_spec.rb index 973a1e76679..8879636e4dc 100644 --- a/spec/features/projects/active_tabs_spec.rb +++ b/spec/features/projects/active_tabs_spec.rb @@ -55,7 +55,7 @@ RSpec.describe 'Project active tab', feature_category: :groups_and_projects do it_behaves_like 'page has active tab', 'Repository' - %w(Files Commits Graph Compare Branches Tags).each do |sub_menu| + %w[Files Commits Graph Compare Branches Tags].each do |sub_menu| context "on project Repository/#{sub_menu}" do before do click_tab(sub_menu) diff --git a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb index eaf57c566e8..8c8946d67c7 100644 --- a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb @@ -9,7 +9,7 @@ RSpec.describe "User downloads artifacts", feature_category: :build_artifacts do shared_examples "downloading" do it "downloads the zip" do - expect(page.response_headers['Content-Disposition']).to eq(%{attachment; filename="#{job.artifacts_file.filename}"; filename*=UTF-8''#{job.artifacts_file.filename}}) + expect(page.response_headers['Content-Disposition']).to eq(%(attachment; filename="#{job.artifacts_file.filename}"; filename*=UTF-8''#{job.artifacts_file.filename})) expect(page.response_headers['Content-Transfer-Encoding']).to eq("binary") expect(page.response_headers['Content-Type']).to eq("application/zip") expect(page.source.b).to eq(job.artifacts_file.file.read.b) diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index 3abe3ce1396..fdedaa3f469 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Environment', feature_category: :groups_and_projects do end def auto_stop_button_selector - %q{button[title="Prevent environment from auto-stopping"]} + %q(button[title="Prevent environment from auto-stopping"]) end describe 'environment details page', :js do diff --git a/spec/features/projects/integrations/user_activates_jira_spec.rb b/spec/features/projects/integrations/user_activates_jira_spec.rb index 03d5e68d2aa..0bd5020e9bf 100644 --- a/spec/features/projects/integrations/user_activates_jira_spec.rb +++ b/spec/features/projects/integrations/user_activates_jira_spec.rb @@ -47,7 +47,7 @@ RSpec.describe 'User activates Jira', :js, feature_category: :integrations do end it 'activates the Jira integration' do - stub_request(:get, test_url).with(basic_auth: %w(username password)) + stub_request(:get, test_url).with(basic_auth: %w[username password]) .to_raise(JIRA::HTTPError.new(double(message: 'message', code: '200'))) visit_project_integration('Jira') diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index ea41b1b1d8a..12ed2558712 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -306,7 +306,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state, feature_category: :grou artifact_request = requests.find { |req| req.url.include?('artifacts/download') } - expect(artifact_request.response_headers['Content-Disposition']).to eq(%{attachment; filename="#{job.artifacts_file.filename}"; filename*=UTF-8''#{job.artifacts_file.filename}}) + expect(artifact_request.response_headers['Content-Disposition']).to eq(%(attachment; filename="#{job.artifacts_file.filename}"; filename*=UTF-8''#{job.artifacts_file.filename})) expect(artifact_request.response_headers['Content-Transfer-Encoding']).to eq("binary") expect(artifact_request.response_headers['Content-Type']).to eq("image/gif") expect(artifact_request.body).to eq(job.artifacts_file.file.read.b) @@ -939,7 +939,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state, feature_category: :grou context 'when available runners can not run specified tag' do let(:runner) { create(:ci_runner, :instance, active: false) } - let(:job) { create(:ci_build, :pending, pipeline: pipeline, runner: runner, tag_list: %w(docker linux)) } + let(:job) { create(:ci_build, :pending, pipeline: pipeline, runner: runner, tag_list: %w[docker linux]) } it 'renders message about job being stuck because of no runners with the specified tags' do expect(page).to have_selector('[data-testid="job-stuck-with-tags"') @@ -951,7 +951,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state, feature_category: :grou context 'when runners are offline and build has tags' do let(:runner) { create(:ci_runner, :instance, active: true) } - let(:job) { create(:ci_build, :pending, pipeline: pipeline, runner: runner, tag_list: %w(docker linux)) } + let(:job) { create(:ci_build, :pending, pipeline: pipeline, runner: runner, tag_list: %w[docker linux]) } it 'renders message about job being stuck because of no runners with the specified tags' do expect(page).to have_selector('[data-testid="job-stuck-with-tags"') diff --git a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb index 846a0a25891..4898bf253be 100644 --- a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb +++ b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb @@ -40,7 +40,7 @@ RSpec.describe 'Issue prioritization', feature_category: :team_planning do issue_titles = all('.issues-list .issue-title-text').map(&:text) - expect(issue_titles).to eq(%w(issue_4 issue_3 issue_5 issue_2 issue_1)) + expect(issue_titles).to eq(%w[issue_4 issue_3 issue_5 issue_2 issue_1]) end end @@ -80,7 +80,7 @@ RSpec.describe 'Issue prioritization', feature_category: :team_planning do expect(issue_titles[0..1]).to contain_exactly('issue_5', 'issue_8') expect(issue_titles[2..4]).to contain_exactly('issue_1', 'issue_3', 'issue_7') - expect(issue_titles[5..]).to eq(%w(issue_2 issue_4 issue_6)) + expect(issue_titles[5..]).to eq(%w[issue_2 issue_4 issue_6]) end end end diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index ae1ff2557b4..f042a12884c 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -1303,7 +1303,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do page.within('[data-testid="pipeline-details-header"]') do expect(page).to have_selector( - %{span[title="#{pipeline.yaml_errors}"]}) + %(span[title="#{pipeline.yaml_errors}"])) end end @@ -1316,7 +1316,7 @@ RSpec.describe 'Pipeline', :js, feature_category: :continuous_integration do page.within('[data-testid="pipeline-details-header"]') do expect(page).to have_selector( - %{span[title="#{pipeline.present.failure_reason}"]}) + %(span[title="#{pipeline.present.failure_reason}"])) end end end diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index e13f1b610f8..ca3b7f0ad47 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -255,7 +255,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do it 'contains badge with tooltip which contains error' do expect(pipeline).to have_yaml_errors expect(page).to have_selector( - %{span[title="#{pipeline.yaml_errors}"]}) + %(span[title="#{pipeline.yaml_errors}"])) end it 'contains badge that indicates failure reason' do @@ -265,7 +265,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do it 'contains badge with tooltip which contains failure reason' do expect(pipeline.failure_reason?).to eq true expect(page).to have_selector( - %{span[title="#{pipeline.present.failure_reason}"]}) + %(span[title="#{pipeline.present.failure_reason}"])) end end @@ -818,7 +818,7 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do describe 'when the `ios_specific_templates` experiment is enabled and the "Set up a runner" button is clicked' do before do stub_experiments(ios_specific_templates: :candidate) - project.project_setting.update!(target_platforms: %w(ios)) + project.project_setting.update!(target_platforms: %w[ios]) visit project_pipelines_path(project) click_button 'Set up a runner' end diff --git a/spec/features/tags/developer_views_tags_spec.rb b/spec/features/tags/developer_views_tags_spec.rb index 81a41951377..154311853f8 100644 --- a/spec/features/tags/developer_views_tags_spec.rb +++ b/spec/features/tags/developer_views_tags_spec.rb @@ -43,7 +43,7 @@ RSpec.describe 'Developer views tags', feature_category: :source_code_management it 'avoids a N+1 query in branches index' do control_count = ActiveRecord::QueryRecorder.new { visit project_tags_path(project) }.count - %w(one two three four five).each { |tag| repository.add_tag(user, tag, 'master', 'foo') } + %w[one two three four five].each { |tag| repository.add_tag(user, tag, 'master', 'foo') } expect { visit project_tags_path(project) }.not_to exceed_query_limit(control_count) end diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb index c07e419be1f..87afcbd416b 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -887,7 +887,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions, feature_category: :system_ it 'correctly renders tabs and panes' do visit new_user_session_path - ensure_tab_pane_correctness(%w(Crowd Standard)) + ensure_tab_pane_correctness(%w[Crowd Standard]) end it 'displays the remember me checkbox' do diff --git a/spec/finders/alert_management/alerts_finder_spec.rb b/spec/finders/alert_management/alerts_finder_spec.rb index 3c37d52d6c3..4d0324b9f1a 100644 --- a/spec/finders/alert_management/alerts_finder_spec.rb +++ b/spec/finders/alert_management/alerts_finder_spec.rb @@ -183,7 +183,7 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do let(:params) { { sort: 'severity_asc' } } it 'sorts alerts by severity from less critical to more critical' do - expect(execute.pluck(:severity).uniq).to eq(%w(unknown info low medium high critical)) + expect(execute.pluck(:severity).uniq).to eq(%w[unknown info low medium high critical]) end end @@ -191,7 +191,7 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do let(:params) { { sort: 'severity_desc' } } it 'sorts alerts by severity from more critical to less critical' do - expect(execute.pluck(:severity).uniq).to eq(%w(critical high medium low info unknown)) + expect(execute.pluck(:severity).uniq).to eq(%w[critical high medium low info unknown]) end end end diff --git a/spec/finders/branches_finder_spec.rb b/spec/finders/branches_finder_spec.rb index 9f185c8b8fb..004629eda95 100644 --- a/spec/finders/branches_finder_spec.rb +++ b/spec/finders/branches_finder_spec.rb @@ -92,7 +92,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do result = subject expect(result.count).to eq(3) - expect(result.map(&:name)).to eq(%w{csv fix lfs}) + expect(result.map(&:name)).to eq(%w[csv fix lfs]) end end @@ -265,7 +265,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(feature_conflict few-commits)) + expect(result.map(&:name)).to eq(%w[feature_conflict few-commits]) end end @@ -275,7 +275,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(fix flatten-dir)) + expect(result.map(&:name)).to eq(%w[fix flatten-dir]) end end @@ -306,7 +306,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(feature improve/awesome merge-test markdown feature_conflict)) + expect(result.map(&:name)).to eq(%w[feature improve/awesome merge-test markdown feature_conflict]) end end @@ -316,7 +316,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(merge-test markdown)) + expect(result.map(&:name)).to eq(%w[merge-test markdown]) end end end @@ -328,7 +328,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do result = subject expect(result.count).to eq(3) - expect(result.map(&:name)).to eq(%w{csv fix lfs}) + expect(result.map(&:name)).to eq(%w[csv fix lfs]) end end @@ -338,7 +338,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'falls back to default execute and ignore paginations' do result = subject - expect(result.map(&:name)).to eq(%w(feature feature_conflict few-commits fix flatten-dir)) + expect(result.map(&:name)).to eq(%w[feature feature_conflict few-commits fix flatten-dir]) end end end diff --git a/spec/finders/ci/runners_finder_spec.rb b/spec/finders/ci/runners_finder_spec.rb index 5d249ddb391..06cca035c6f 100644 --- a/spec/finders/ci/runners_finder_spec.rb +++ b/spec/finders/ci/runners_finder_spec.rb @@ -171,7 +171,7 @@ RSpec.describe Ci::RunnersFinder, feature_category: :runner_fleet do it_behaves_like 'sorts by created_at descending' end - %w(created_date created_at_desc).each do |sort| + %w[created_date created_at_desc].each do |sort| context "with sort param equal to #{sort}" do let(:params) { { sort: sort } } diff --git a/spec/finders/environments/environments_finder_spec.rb b/spec/finders/environments/environments_finder_spec.rb index df66bbdc235..e3b1a121497 100644 --- a/spec/finders/environments/environments_finder_spec.rb +++ b/spec/finders/environments/environments_finder_spec.rb @@ -24,13 +24,13 @@ RSpec.describe Environments::EnvironmentsFinder do end it 'returns environments with any of the requested states' do - result = described_class.new(project, user, states: %w(available stopped)).execute + result = described_class.new(project, user, states: %w[available stopped]).execute expect(result).to contain_exactly(environment, environment_stopped, environment_available, stopped_environment) end it 'raises exception when requested state is invalid' do - expect { described_class.new(project, user, states: %w(invalid stopped)).execute }.to( + expect { described_class.new(project, user, states: %w[invalid stopped]).execute }.to( raise_error(described_class::InvalidStatesError, 'Requested states are invalid') ) end diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb index 23d73b48199..f20c03c9658 100644 --- a/spec/finders/groups_finder_spec.rb +++ b/spec/finders/groups_finder_spec.rb @@ -12,30 +12,30 @@ RSpec.describe GroupsFinder, feature_category: :groups_and_projects do using RSpec::Parameterized::TableSyntax where(:user_type, :params, :results) do - nil | { all_available: true } | %i(public_group user_public_group) - nil | { all_available: false } | %i(public_group user_public_group) - nil | {} | %i(public_group user_public_group) - - :regular | { all_available: true } | %i(public_group internal_group user_public_group user_internal_group - user_private_group) - :regular | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :regular | {} | %i(public_group internal_group user_public_group user_internal_group user_private_group) - :regular | { min_access_level: Gitlab::Access::DEVELOPER } | %i(user_public_group user_internal_group user_private_group) - - :external | { all_available: true } | %i(public_group user_public_group user_internal_group user_private_group) - :external | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :external | {} | %i(public_group user_public_group user_internal_group user_private_group) - - :admin_without_admin_mode | { all_available: true } | %i(public_group internal_group user_public_group - user_internal_group user_private_group) - :admin_without_admin_mode | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :admin_without_admin_mode | {} | %i(public_group internal_group user_public_group user_internal_group user_private_group) - - :admin_with_admin_mode | { all_available: true } | %i(public_group internal_group private_group user_public_group - user_internal_group user_private_group) - :admin_with_admin_mode | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :admin_with_admin_mode | {} | %i(public_group internal_group private_group user_public_group user_internal_group - user_private_group) + nil | { all_available: true } | %i[public_group user_public_group] + nil | { all_available: false } | %i[public_group user_public_group] + nil | {} | %i[public_group user_public_group] + + :regular | { all_available: true } | %i[public_group internal_group user_public_group user_internal_group + user_private_group] + :regular | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :regular | {} | %i[public_group internal_group user_public_group user_internal_group user_private_group] + :regular | { min_access_level: Gitlab::Access::DEVELOPER } | %i[user_public_group user_internal_group user_private_group] + + :external | { all_available: true } | %i[public_group user_public_group user_internal_group user_private_group] + :external | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :external | {} | %i[public_group user_public_group user_internal_group user_private_group] + + :admin_without_admin_mode | { all_available: true } | %i[public_group internal_group user_public_group + user_internal_group user_private_group] + :admin_without_admin_mode | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :admin_without_admin_mode | {} | %i[public_group internal_group user_public_group user_internal_group user_private_group] + + :admin_with_admin_mode | { all_available: true } | %i[public_group internal_group private_group user_public_group + user_internal_group user_private_group] + :admin_with_admin_mode | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :admin_with_admin_mode | {} | %i[public_group internal_group private_group user_public_group user_internal_group + user_private_group] end with_them do diff --git a/spec/finders/license_template_finder_spec.rb b/spec/finders/license_template_finder_spec.rb index 754b92faccc..21c4cf74fd0 100644 --- a/spec/finders/license_template_finder_spec.rb +++ b/spec/finders/license_template_finder_spec.rb @@ -75,7 +75,7 @@ RSpec.describe LicenseTemplateFinder do context 'template names hash keys' do it 'has all the expected keys' do - expect(template_names.values.flatten.first.keys).to match_array(%i(id key name project_id)) + expect(template_names.values.flatten.first.keys).to match_array(%i[id key name project_id]) end end end diff --git a/spec/finders/merge_requests_finder_spec.rb b/spec/finders/merge_requests_finder_spec.rb index 9aa98189f30..3f9c1baec82 100644 --- a/spec/finders/merge_requests_finder_spec.rb +++ b/spec/finders/merge_requests_finder_spec.rb @@ -163,9 +163,9 @@ RSpec.describe MergeRequestsFinder, feature_category: :code_review_workflow do it { is_expected.to eq([merge_request2]) } it 'queries merge_request_metrics.target_project_id table' do - expect(query.to_sql).to include(%{"merge_request_metrics"."target_project_id" = #{merge_request2.target_project_id}}) + expect(query.to_sql).to include(%("merge_request_metrics"."target_project_id" = #{merge_request2.target_project_id})) - expect(query.to_sql).not_to include(%{"merge_requests"."target_project_id"}) + expect(query.to_sql).not_to include(%("merge_requests"."target_project_id")) end end end @@ -537,7 +537,7 @@ RSpec.describe MergeRequestsFinder, feature_category: :code_review_workflow do context 'filtering by approved by username' do let(:params) { { approved_by_usernames: user2.username } } - where(:sort) { [nil] + %w(milestone merged_at merged_at_desc closed_at closed_at_desc) } + where(:sort) { [nil] + %w[milestone merged_at merged_at_desc closed_at closed_at_desc] } before do create(:approval, merge_request: merge_request3, user: user2) diff --git a/spec/finders/tags_finder_spec.rb b/spec/finders/tags_finder_spec.rb index 2af23c466fb..525c19ba137 100644 --- a/spec/finders/tags_finder_spec.rb +++ b/spec/finders/tags_finder_spec.rb @@ -133,7 +133,7 @@ RSpec.describe TagsFinder do it 'filters tags' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.0)) + expect(result.map(&:name)).to eq(%w[v1.1.0]) end end @@ -143,7 +143,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.1)) + expect(result.map(&:name)).to eq(%w[v1.1.1]) end end @@ -153,7 +153,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.0.0 v1.1.0)) + expect(result.map(&:name)).to eq(%w[v1.0.0 v1.1.0]) end end @@ -174,7 +174,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.1 v1.1.0 v1.0.0)) + expect(result.map(&:name)).to eq(%w[v1.1.1 v1.1.0 v1.0.0]) end end @@ -184,7 +184,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.0 v1.0.0)) + expect(result.map(&:name)).to eq(%w[v1.1.0 v1.0.0]) end end end @@ -195,7 +195,7 @@ RSpec.describe TagsFinder do it 'ignores the pagination for search' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.1)) + expect(result.map(&:name)).to eq(%w[v1.1.1]) end end end diff --git a/spec/finders/template_finder_spec.rb b/spec/finders/template_finder_spec.rb index eacce0bd996..57956b5aa95 100644 --- a/spec/finders/template_finder_spec.rb +++ b/spec/finders/template_finder_spec.rb @@ -189,7 +189,7 @@ RSpec.describe TemplateFinder do context 'template names hash keys' do it 'has all the expected keys' do - expect(result.first.to_h.keys).to match_array(%i(id key name project_id)) + expect(result.first.to_h.keys).to match_array(%i[id key name project_id]) end end end @@ -223,7 +223,7 @@ RSpec.describe TemplateFinder do context 'template names hash keys' do it 'has all the expected keys' do - expect(result.first.to_h.keys).to match_array(%i(id key name project_id)) + expect(result.first.to_h.keys).to match_array(%i[id key name project_id]) end end end |