summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-06 00:12:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-06 00:12:24 +0000
commitf48ded4221ac830ff354693740cf919052359e00 (patch)
tree9da7807e75043104cab4892e405fd990f25a1542 /spec/lib
parentccfa4b271b5a24d350b3389dc1f43b25177d03ed (diff)
downloadgitlab-ce-f48ded4221ac830ff354693740cf919052359e00.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/import_export/group/object_builder_spec.rb4
-rw-r--r--spec/lib/gitlab/import_export/group/relation_tree_restorer_spec.rb18
-rw-r--r--spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb18
-rw-r--r--spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb18
-rw-r--r--spec/lib/gitlab/import_sources_spec.rb20
-rw-r--r--spec/lib/gitlab/instrumentation_helper_spec.rb14
-rw-r--r--spec/lib/gitlab/jira/middleware_spec.rb2
-rw-r--r--spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb4
-rw-r--r--spec/lib/gitlab/metrics/dashboard/importers/prometheus_metrics_spec.rb30
-rw-r--r--spec/lib/gitlab/metrics/dashboard/validator/errors_spec.rb38
-rw-r--r--spec/lib/gitlab/metrics/dashboard/validator_spec.rb24
-rw-r--r--spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb10
-rw-r--r--spec/lib/gitlab/metrics/subscribers/action_view_spec.rb2
-rw-r--r--spec/lib/gitlab/metrics/subscribers/active_record_spec.rb6
-rw-r--r--spec/lib/gitlab/metrics/subscribers/load_balancing_spec.rb4
-rw-r--r--spec/lib/sidebars/groups/menus/settings_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/settings_menu_spec.rb2
17 files changed, 107 insertions, 109 deletions
diff --git a/spec/lib/gitlab/import_export/group/object_builder_spec.rb b/spec/lib/gitlab/import_export/group/object_builder_spec.rb
index 09f40199b31..25d9858dd4c 100644
--- a/spec/lib/gitlab/import_export/group/object_builder_spec.rb
+++ b/spec/lib/gitlab/import_export/group/object_builder_spec.rb
@@ -6,9 +6,9 @@ RSpec.describe Gitlab::ImportExport::Group::ObjectBuilder do
let(:group) { create(:group) }
let(:base_attributes) do
{
- 'title' => 'title',
+ 'title' => 'title',
'description' => 'description',
- 'group' => group
+ 'group' => group
}
end
diff --git a/spec/lib/gitlab/import_export/group/relation_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/group/relation_tree_restorer_spec.rb
index 2f1e2dd2db4..5e84284a060 100644
--- a/spec/lib/gitlab/import_export/group/relation_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/group/relation_tree_restorer_spec.rb
@@ -33,15 +33,15 @@ RSpec.describe Gitlab::ImportExport::Group::RelationTreeRestorer do
let(:relation_tree_restorer) do
described_class.new(
- user: user,
- shared: shared,
- relation_reader: relation_reader,
- object_builder: Gitlab::ImportExport::Group::ObjectBuilder,
- members_mapper: members_mapper,
- relation_factory: Gitlab::ImportExport::Group::RelationFactory,
- reader: reader,
- importable: importable,
- importable_path: nil,
+ user: user,
+ shared: shared,
+ relation_reader: relation_reader,
+ object_builder: Gitlab::ImportExport::Group::ObjectBuilder,
+ members_mapper: members_mapper,
+ relation_factory: Gitlab::ImportExport::Group::RelationFactory,
+ reader: reader,
+ importable: importable,
+ importable_path: nil,
importable_attributes: attributes
)
end
diff --git a/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb
index b7b652005e9..ac646087a95 100644
--- a/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb
@@ -21,15 +21,15 @@ RSpec.describe Gitlab::ImportExport::Project::RelationTreeRestorer do
let(:reader) { Gitlab::ImportExport::Reader.new(shared: shared) }
let(:relation_tree_restorer) do
described_class.new(
- user: user,
- shared: shared,
- relation_reader: relation_reader,
- object_builder: Gitlab::ImportExport::Project::ObjectBuilder,
- members_mapper: members_mapper,
- relation_factory: Gitlab::ImportExport::Project::RelationFactory,
- reader: reader,
- importable: importable,
- importable_path: 'project',
+ user: user,
+ shared: shared,
+ relation_reader: relation_reader,
+ object_builder: Gitlab::ImportExport::Project::ObjectBuilder,
+ members_mapper: members_mapper,
+ relation_factory: Gitlab::ImportExport::Project::RelationFactory,
+ reader: reader,
+ importable: importable,
+ importable_path: 'project',
importable_attributes: attributes
)
end
diff --git a/spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb
index 3dab84af744..d1fe9b80062 100644
--- a/spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb
@@ -21,15 +21,15 @@ RSpec.describe Gitlab::ImportExport::Project::Sample::RelationTreeRestorer do
let(:relation_reader) { Gitlab::ImportExport::Json::NdjsonReader.new(path) }
let(:sample_data_relation_tree_restorer) do
described_class.new(
- user: user,
- shared: shared,
- relation_reader: relation_reader,
- object_builder: Gitlab::ImportExport::Project::ObjectBuilder,
- members_mapper: members_mapper,
- relation_factory: Gitlab::ImportExport::Project::Sample::RelationFactory,
- reader: reader,
- importable: importable,
- importable_path: 'project',
+ user: user,
+ shared: shared,
+ relation_reader: relation_reader,
+ object_builder: Gitlab::ImportExport::Project::ObjectBuilder,
+ members_mapper: members_mapper,
+ relation_factory: Gitlab::ImportExport::Project::Sample::RelationFactory,
+ reader: reader,
+ importable: importable,
+ importable_path: 'project',
importable_attributes: attributes
)
end
diff --git a/spec/lib/gitlab/import_sources_spec.rb b/spec/lib/gitlab/import_sources_spec.rb
index f42a109aa3a..41ffcece221 100644
--- a/spec/lib/gitlab/import_sources_spec.rb
+++ b/spec/lib/gitlab/import_sources_spec.rb
@@ -7,17 +7,17 @@ RSpec.describe Gitlab::ImportSources do
it 'returns a hash' do
expected =
{
- 'GitHub' => 'github',
- 'Bitbucket Cloud' => 'bitbucket',
- 'Bitbucket Server' => 'bitbucket_server',
- 'GitLab.com' => 'gitlab',
- 'Google Code' => 'google_code',
- 'FogBugz' => 'fogbugz',
+ 'GitHub' => 'github',
+ 'Bitbucket Cloud' => 'bitbucket',
+ 'Bitbucket Server' => 'bitbucket_server',
+ 'GitLab.com' => 'gitlab',
+ 'Google Code' => 'google_code',
+ 'FogBugz' => 'fogbugz',
'Repository by URL' => 'git',
- 'GitLab export' => 'gitlab_project',
- 'Gitea' => 'gitea',
- 'Manifest file' => 'manifest',
- 'Phabricator' => 'phabricator'
+ 'GitLab export' => 'gitlab_project',
+ 'Gitea' => 'gitea',
+ 'Manifest file' => 'manifest',
+ 'Phabricator' => 'phabricator'
}
expect(described_class.options).to eq(expected)
diff --git a/spec/lib/gitlab/instrumentation_helper_spec.rb b/spec/lib/gitlab/instrumentation_helper_spec.rb
index 4fa9079144d..d5ff39767c4 100644
--- a/spec/lib/gitlab/instrumentation_helper_spec.rb
+++ b/spec/lib/gitlab/instrumentation_helper_spec.rb
@@ -140,13 +140,13 @@ RSpec.describe Gitlab::InstrumentationHelper do
subject
expect(payload).to include(db_replica_count: 0,
- db_replica_cached_count: 0,
- db_primary_count: 0,
- db_primary_cached_count: 0,
- db_primary_wal_count: 0,
- db_replica_wal_count: 0,
- db_primary_wal_cached_count: 0,
- db_replica_wal_cached_count: 0)
+ db_replica_cached_count: 0,
+ db_primary_count: 0,
+ db_primary_cached_count: 0,
+ db_primary_wal_count: 0,
+ db_replica_wal_count: 0,
+ db_primary_wal_cached_count: 0,
+ db_replica_wal_cached_count: 0)
end
context 'when replica caught up search was made' do
diff --git a/spec/lib/gitlab/jira/middleware_spec.rb b/spec/lib/gitlab/jira/middleware_spec.rb
index 1d1f7368534..09cf67d0657 100644
--- a/spec/lib/gitlab/jira/middleware_spec.rb
+++ b/spec/lib/gitlab/jira/middleware_spec.rb
@@ -24,7 +24,7 @@ RSpec.describe Gitlab::Jira::Middleware do
describe '#call' do
it 'adjusts HTTP_AUTHORIZATION env when request from Jira DVCS user agent' do
expect(app).to receive(:call).with({ 'HTTP_USER_AGENT' => jira_user_agent,
- 'HTTP_AUTHORIZATION' => 'Bearer hash-123' })
+ 'HTTP_AUTHORIZATION' => 'Bearer hash-123' })
middleware.call('HTTP_USER_AGENT' => jira_user_agent, 'HTTP_AUTHORIZATION' => 'token hash-123')
end
diff --git a/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb b/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb
index 81910773dfa..57f2b1cfd96 100644
--- a/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb
+++ b/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb
@@ -174,8 +174,8 @@ RSpec.describe Gitlab::MarkdownCache::ActiveRecord::Extension do
expect(thing).to receive(:update_columns)
.with({ "title_html" => updated_html,
- "description_html" => "",
- "cached_markdown_version" => cache_version })
+ "description_html" => "",
+ "cached_markdown_version" => cache_version })
thing.refresh_markdown_cache!
end
diff --git a/spec/lib/gitlab/metrics/dashboard/importers/prometheus_metrics_spec.rb b/spec/lib/gitlab/metrics/dashboard/importers/prometheus_metrics_spec.rb
index c15e717b126..bc6cd383758 100644
--- a/spec/lib/gitlab/metrics/dashboard/importers/prometheus_metrics_spec.rb
+++ b/spec/lib/gitlab/metrics/dashboard/importers/prometheus_metrics_spec.rb
@@ -24,13 +24,13 @@ RSpec.describe Gitlab::Metrics::Dashboard::Importers::PrometheusMetrics do
context 'with existing metrics' do
let(:existing_metric_attributes) do
{
- project: project,
- identifier: 'metric_b',
- title: 'overwrite',
- y_label: 'overwrite',
- query: 'overwrite',
- unit: 'overwrite',
- legend: 'overwrite',
+ project: project,
+ identifier: 'metric_b',
+ title: 'overwrite',
+ y_label: 'overwrite',
+ query: 'overwrite',
+ unit: 'overwrite',
+ legend: 'overwrite',
dashboard_path: dashboard_path
}
end
@@ -43,11 +43,11 @@ RSpec.describe Gitlab::Metrics::Dashboard::Importers::PrometheusMetrics do
subject.execute
expect(existing_metric.reload.attributes.with_indifferent_access).to include({
- title: 'Super Chart B',
+ title: 'Super Chart B',
y_label: 'y_label',
- query: 'query',
- unit: 'unit',
- legend: 'Legend Label'
+ query: 'query',
+ unit: 'unit',
+ legend: 'Legend Label'
})
end
@@ -69,11 +69,11 @@ RSpec.describe Gitlab::Metrics::Dashboard::Importers::PrometheusMetrics do
subject.execute
expect(existing_metric.reload.attributes.with_indifferent_access).to include({
- title: 'Super Chart B',
+ title: 'Super Chart B',
y_label: 'y_label',
- query: 'query',
- unit: 'unit',
- legend: 'Legend Label'
+ query: 'query',
+ unit: 'unit',
+ legend: 'Legend Label'
})
end
diff --git a/spec/lib/gitlab/metrics/dashboard/validator/errors_spec.rb b/spec/lib/gitlab/metrics/dashboard/validator/errors_spec.rb
index fdbba6c31b5..a50c2a506cb 100644
--- a/spec/lib/gitlab/metrics/dashboard/validator/errors_spec.rb
+++ b/spec/lib/gitlab/metrics/dashboard/validator/errors_spec.rb
@@ -17,11 +17,11 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator::Errors do
let(:error_hash) do
{
- 'data' => 'property_name',
+ 'data' => 'property_name',
'data_pointer' => pointer,
- 'type' => type,
- 'schema' => 'schema',
- 'details' => details
+ 'type' => type,
+ 'schema' => 'schema',
+ 'details' => details
}
end
@@ -72,10 +72,10 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator::Errors do
let(:type) { 'pattern' }
let(:error_hash) do
{
- 'data' => 'property_name',
+ 'data' => 'property_name',
'data_pointer' => pointer,
- 'type' => type,
- 'schema' => { 'pattern' => 'aa.*' }
+ 'type' => type,
+ 'schema' => { 'pattern' => 'aa.*' }
}
end
@@ -86,10 +86,10 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator::Errors do
let(:type) { 'format' }
let(:error_hash) do
{
- 'data' => 'property_name',
+ 'data' => 'property_name',
'data_pointer' => pointer,
- 'type' => type,
- 'schema' => { 'format' => 'date-time' }
+ 'type' => type,
+ 'schema' => { 'format' => 'date-time' }
}
end
@@ -100,10 +100,10 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator::Errors do
let(:type) { 'const' }
let(:error_hash) do
{
- 'data' => 'property_name',
+ 'data' => 'property_name',
'data_pointer' => pointer,
- 'type' => type,
- 'schema' => { 'const' => 'one' }
+ 'type' => type,
+ 'schema' => { 'const' => 'one' }
}
end
@@ -114,10 +114,10 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator::Errors do
let(:type) { 'enum' }
let(:error_hash) do
{
- 'data' => 'property_name',
+ 'data' => 'property_name',
'data_pointer' => pointer,
- 'type' => type,
- 'schema' => { 'enum' => %w(one two) }
+ 'type' => type,
+ 'schema' => { 'enum' => %w(one two) }
}
end
@@ -128,10 +128,10 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator::Errors do
let(:type) { 'unknown' }
let(:error_hash) do
{
- 'data' => 'property_name',
+ 'data' => 'property_name',
'data_pointer' => pointer,
- 'type' => type,
- 'schema' => 'schema'
+ 'type' => type,
+ 'schema' => 'schema'
}
end
diff --git a/spec/lib/gitlab/metrics/dashboard/validator_spec.rb b/spec/lib/gitlab/metrics/dashboard/validator_spec.rb
index eb67ea2b7da..aaa9daf8fee 100644
--- a/spec/lib/gitlab/metrics/dashboard/validator_spec.rb
+++ b/spec/lib/gitlab/metrics/dashboard/validator_spec.rb
@@ -33,9 +33,9 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator do
context 'with metric identifier present in current dashboard' do
before do
create(:prometheus_metric,
- identifier: 'metric_a1',
+ identifier: 'metric_a1',
dashboard_path: 'test/path.yml',
- project: project
+ project: project
)
end
@@ -45,9 +45,9 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator do
context 'with metric identifier present in another dashboard' do
before do
create(:prometheus_metric,
- identifier: 'metric_a1',
+ identifier: 'metric_a1',
dashboard_path: 'some/other/dashboard/path.yml',
- project: project
+ project: project
)
end
@@ -94,9 +94,9 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator do
context 'with metric identifier present in current dashboard' do
before do
create(:prometheus_metric,
- identifier: 'metric_a1',
+ identifier: 'metric_a1',
dashboard_path: 'test/path.yml',
- project: project
+ project: project
)
end
@@ -106,9 +106,9 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator do
context 'with metric identifier present in another dashboard' do
before do
create(:prometheus_metric,
- identifier: 'metric_a1',
+ identifier: 'metric_a1',
dashboard_path: 'some/other/dashboard/path.yml',
- project: project
+ project: project
)
end
@@ -166,9 +166,9 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator do
context 'with metric identifier present in current dashboard' do
before do
create(:prometheus_metric,
- identifier: 'metric_a1',
+ identifier: 'metric_a1',
dashboard_path: 'test/path.yml',
- project: project
+ project: project
)
end
@@ -178,9 +178,9 @@ RSpec.describe Gitlab::Metrics::Dashboard::Validator do
context 'with metric identifier present in another dashboard' do
before do
create(:prometheus_metric,
- identifier: 'metric_a1',
+ identifier: 'metric_a1',
dashboard_path: 'some/other/dashboard/path.yml',
- project: project
+ project: project
)
end
diff --git a/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb
index 3396de9b12c..ed78548ef62 100644
--- a/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb
+++ b/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb
@@ -194,9 +194,8 @@ RSpec.describe Gitlab::Metrics::RequestsRackMiddleware, :aggregate_failures do
let(:endpoint) do
route = double(:route, request_method: 'GET', path: '/:version/projects/:id/archive(.:format)')
- double(:endpoint, route: route,
- options: { for: api_handler, path: [":id/archive"] },
- namespace: "/projects")
+ double(:endpoint,
+ route: route, options: { for: api_handler, path: [":id/archive"] }, namespace: "/projects")
end
let(:env) { { 'api.endpoint' => endpoint, 'REQUEST_METHOD' => 'GET' } }
@@ -256,9 +255,8 @@ RSpec.describe Gitlab::Metrics::RequestsRackMiddleware, :aggregate_failures do
context 'Grape API without expected duration' do
let(:endpoint) do
route = double(:route, request_method: 'GET', path: '/:version/projects/:id/archive(.:format)')
- double(:endpoint, route: route,
- options: { for: api_handler, path: [":id/archive"] },
- namespace: "/projects")
+ double(:endpoint,
+ route: route, options: { for: api_handler, path: [":id/archive"] }, namespace: "/projects")
end
let(:env) { { 'api.endpoint' => endpoint, 'REQUEST_METHOD' => 'GET' } }
diff --git a/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb b/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
index adbc474343f..67cd8630758 100644
--- a/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
+++ b/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActionView do
root = Rails.root.to_s
double(:event, duration: 2.1,
- payload: { identifier: "#{root}/app/views/x.html.haml" })
+ payload: { identifier: "#{root}/app/views/x.html.haml" })
end
before do
diff --git a/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb b/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
index 28c3ef229ab..005c1ae2d0a 100644
--- a/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
+++ b/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
@@ -137,7 +137,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do
:event,
name: 'transaction.active_record',
duration: 230,
- payload: { connection: connection }
+ payload: { connection: connection }
)
end
@@ -213,7 +213,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do
:event,
name: 'sql.active_record',
duration: 2,
- payload: payload
+ payload: payload
)
end
@@ -278,7 +278,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do
:event,
name: 'sql.active_record',
duration: 2,
- payload: payload
+ payload: payload
)
end
diff --git a/spec/lib/gitlab/metrics/subscribers/load_balancing_spec.rb b/spec/lib/gitlab/metrics/subscribers/load_balancing_spec.rb
index bc6effd0438..7f7efaffd9e 100644
--- a/spec/lib/gitlab/metrics/subscribers/load_balancing_spec.rb
+++ b/spec/lib/gitlab/metrics/subscribers/load_balancing_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::LoadBalancing, :request_store do
double(
:event,
name: 'load_balancing.caught_up_replica_pick',
- payload: payload
+ payload: payload
)
end
@@ -37,7 +37,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::LoadBalancing, :request_store do
double(
:event,
name: 'load_balancing.web_transaction_completed',
- payload: {}
+ payload: {}
)
end
diff --git a/spec/lib/sidebars/groups/menus/settings_menu_spec.rb b/spec/lib/sidebars/groups/menus/settings_menu_spec.rb
index 252da8ea699..4e3c639672b 100644
--- a/spec/lib/sidebars/groups/menus/settings_menu_spec.rb
+++ b/spec/lib/sidebars/groups/menus/settings_menu_spec.rb
@@ -80,7 +80,7 @@ RSpec.describe Sidebars::Groups::Menus::SettingsMenu do
it_behaves_like 'access rights checks'
end
- describe 'Packages & Registries' do
+ describe 'Packages and registries' do
let(:item_id) { :packages_and_registries }
before do
diff --git a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
index f41f7a01d88..904b9f041b1 100644
--- a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
@@ -133,7 +133,7 @@ RSpec.describe Sidebars::Projects::Menus::SettingsMenu do
end
end
- describe 'Packages & Registries' do
+ describe 'Packages and registries' do
let(:item_id) { :packages_and_registries }
let(:packages_enabled) { false }