Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5176313c
Commit
5176313c
authored
Apr 28, 2020
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autocorrect Gitlab/Json cop in /ee
Runs the autocorrector over the ee directory.
parent
4f46a580
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
81 additions
and
93 deletions
+81
-93
ee/app/controllers/ee/admin/application_settings_controller.rb
...p/controllers/ee/admin/application_settings_controller.rb
+1
-1
ee/app/models/ee/mock_deployment_service.rb
ee/app/models/ee/mock_deployment_service.rb
+1
-1
ee/app/models/vulnerabilities/occurrence.rb
ee/app/models/vulnerabilities/occurrence.rb
+1
-1
ee/app/services/dependency_proxy/request_token_service.rb
ee/app/services/dependency_proxy/request_token_service.rb
+1
-1
ee/app/services/fetch_subscription_plans_service.rb
ee/app/services/fetch_subscription_plans_service.rb
+1
-1
ee/app/services/geo/container_repository_sync.rb
ee/app/services/geo/container_repository_sync.rb
+1
-1
ee/db/fixtures/development/26_packages.rb
ee/db/fixtures/development/26_packages.rb
+1
-2
ee/lib/gitlab/ci/parsers/license_compliance/license_scanning.rb
.../gitlab/ci/parsers/license_compliance/license_scanning.rb
+1
-1
ee/lib/gitlab/ci/parsers/security/common.rb
ee/lib/gitlab/ci/parsers/security/common.rb
+1
-1
ee/lib/gitlab/ci/parsers/security/dependency_list.rb
ee/lib/gitlab/ci/parsers/security/dependency_list.rb
+1
-1
ee/lib/gitlab/ci/parsers/security/scanned_resources.rb
ee/lib/gitlab/ci/parsers/security/scanned_resources.rb
+1
-1
ee/lib/gitlab/geo/jwt_request_decoder.rb
ee/lib/gitlab/geo/jwt_request_decoder.rb
+1
-1
ee/lib/gitlab/spdx/catalogue_gateway.rb
ee/lib/gitlab/spdx/catalogue_gateway.rb
+1
-1
ee/spec/controllers/projects/pipelines_controller_spec.rb
ee/spec/controllers/projects/pipelines_controller_spec.rb
+1
-1
ee/spec/controllers/projects/service_desk_controller_spec.rb
ee/spec/controllers/projects/service_desk_controller_spec.rb
+1
-1
ee/spec/factories/spdx_catalogue.rb
ee/spec/factories/spdx_catalogue.rb
+1
-1
ee/spec/factories/vulnerabilities/occurrences.rb
ee/spec/factories/vulnerabilities/occurrences.rb
+2
-2
ee/spec/features/billings/billing_plans_spec.rb
ee/spec/features/billings/billing_plans_spec.rb
+1
-1
ee/spec/features/projects/licenses/maintainer_views_policies_spec.rb
...tures/projects/licenses/maintainer_views_policies_spec.rb
+1
-1
ee/spec/features/trials/show_trial_banner_spec.rb
ee/spec/features/trials/show_trial_banner_spec.rb
+1
-1
ee/spec/finders/security/pipeline_vulnerabilities_finder_spec.rb
.../finders/security/pipeline_vulnerabilities_finder_spec.rb
+1
-1
ee/spec/finders/status_page/incident_comments_finder_spec.rb
ee/spec/finders/status_page/incident_comments_finder_spec.rb
+1
-1
ee/spec/graphql/types/vulnerability_type_spec.rb
ee/spec/graphql/types/vulnerability_type_spec.rb
+1
-1
ee/spec/helpers/vulnerabilities_helper_spec.rb
ee/spec/helpers/vulnerabilities_helper_spec.rb
+1
-1
ee/spec/lib/ee/api/helpers_spec.rb
ee/spec/lib/ee/api/helpers_spec.rb
+6
-6
ee/spec/lib/ee/gitlab/import_export/group/tree_saver_spec.rb
ee/spec/lib/ee/gitlab/import_export/group/tree_saver_spec.rb
+1
-1
ee/spec/lib/gitlab/ci/parsers/license_compliance/license_scanning_spec.rb
...ab/ci/parsers/license_compliance/license_scanning_spec.rb
+5
-5
ee/spec/lib/gitlab/ci/parsers/security/container_scanning_spec.rb
...lib/gitlab/ci/parsers/security/container_scanning_spec.rb
+1
-1
ee/spec/lib/gitlab/ci/parsers/security/dependency_scanning_spec.rb
...ib/gitlab/ci/parsers/security/dependency_scanning_spec.rb
+3
-3
ee/spec/lib/gitlab/ci/parsers/security/formatters/dast_spec.rb
...ec/lib/gitlab/ci/parsers/security/formatters/dast_spec.rb
+2
-4
ee/spec/lib/gitlab/ci/parsers/security/formatters/dependency_list_spec.rb
...ab/ci/parsers/security/formatters/dependency_list_spec.rb
+2
-4
ee/spec/lib/gitlab/ci/parsers/security/formatters/deprecated_container_scanning_spec.rb
...security/formatters/deprecated_container_scanning_spec.rb
+2
-4
ee/spec/lib/gitlab/ci/parsers/security/formatters/deprecated_formatted_container_scanning_vulnerability_spec.rb
...ecated_formatted_container_scanning_vulnerability_spec.rb
+2
-4
ee/spec/lib/gitlab/ci/parsers/security/sast_spec.rb
ee/spec/lib/gitlab/ci/parsers/security/sast_spec.rb
+1
-1
ee/spec/lib/gitlab/database/load_balancing/srv_resolver_spec.rb
...c/lib/gitlab/database/load_balancing/srv_resolver_spec.rb
+1
-1
ee/spec/lib/gitlab/geo/oauth/session_spec.rb
ee/spec/lib/gitlab/geo/oauth/session_spec.rb
+1
-1
ee/spec/lib/gitlab/spdx/catalogue_gateway_spec.rb
ee/spec/lib/gitlab/spdx/catalogue_gateway_spec.rb
+1
-1
ee/spec/lib/gitlab/spdx/catalogue_spec.rb
ee/spec/lib/gitlab/spdx/catalogue_spec.rb
+1
-1
ee/spec/presenters/epic_presenter_spec.rb
ee/spec/presenters/epic_presenter_spec.rb
+1
-1
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
...senters/projects/security/configuration_presenter_spec.rb
+6
-6
ee/spec/requests/api/feature_flag_scopes_spec.rb
ee/spec/requests/api/feature_flag_scopes_spec.rb
+2
-2
ee/spec/requests/api/feature_flags_spec.rb
ee/spec/requests/api/feature_flags_spec.rb
+5
-5
ee/spec/requests/api/graphql/boards/board_lists_query_spec.rb
...pec/requests/api/graphql/boards/board_lists_query_spec.rb
+1
-1
ee/spec/requests/api/graphql/project/issue/design_collection/version_spec.rb
...i/graphql/project/issue/design_collection/version_spec.rb
+1
-1
ee/spec/requests/api/graphql/project/issue/design_collection/versions_spec.rb
.../graphql/project/issue/design_collection/versions_spec.rb
+1
-1
ee/spec/requests/api/graphql/project/issue/designs/designs_spec.rb
...equests/api/graphql/project/issue/designs/designs_spec.rb
+1
-1
ee/spec/requests/api/graphql/project/requirements_spec.rb
ee/spec/requests/api/graphql/project/requirements_spec.rb
+1
-1
ee/spec/requests/api/npm_packages_spec.rb
ee/spec/requests/api/npm_packages_spec.rb
+1
-2
ee/spec/services/geo/container_repository_sync_spec.rb
ee/spec/services/geo/container_repository_sync_spec.rb
+2
-2
ee/spec/services/packages/create_dependency_service_spec.rb
ee/spec/services/packages/create_dependency_service_spec.rb
+1
-1
ee/spec/services/packages/npm/create_package_service_spec.rb
ee/spec/services/packages/npm/create_package_service_spec.rb
+2
-4
ee/spec/services/subscriptions/create_service_spec.rb
ee/spec/services/subscriptions/create_service_spec.rb
+1
-1
ee/spec/support/shared_examples/controllers/cluster_metrics_shared_examples.rb
...d_examples/controllers/cluster_metrics_shared_examples.rb
+1
-1
No files found.
ee/app/controllers/ee/admin/application_settings_controller.rb
View file @
5176313c
...
...
@@ -75,7 +75,7 @@ module EE
respond_to
do
|
format
|
format
.
html
do
seat_link_json
=
JSON
.
pretty_generate
(
data
)
seat_link_json
=
Gitlab
::
Json
.
pretty_generate
(
data
)
render
html:
::
Gitlab
::
Highlight
.
highlight
(
'payload.json'
,
seat_link_json
,
language:
'json'
)
end
...
...
ee/app/models/ee/mock_deployment_service.rb
View file @
5176313c
...
...
@@ -17,7 +17,7 @@ module EE
def
rollout_status_instances
data
=
File
.
read
(
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'rollout_status_instances.json'
))
JSON
.
parse
(
data
)
Gitlab
::
Json
.
parse
(
data
)
end
def
rollout_status_deployments
...
...
ee/app/models/vulnerabilities/occurrence.rb
View file @
5176313c
...
...
@@ -228,7 +228,7 @@ module Vulnerabilities
def
metadata
strong_memoize
(
:metadata
)
do
JSON
.
parse
(
raw_metadata
)
Gitlab
::
Json
.
parse
(
raw_metadata
)
rescue
JSON
::
ParserError
{}
end
...
...
ee/app/services/dependency_proxy/request_token_service.rb
View file @
5176313c
...
...
@@ -10,7 +10,7 @@ module DependencyProxy
response
=
Gitlab
::
HTTP
.
get
(
auth_url
)
if
response
.
success?
success
(
token:
JSON
.
parse
(
response
.
body
)[
'token'
])
success
(
token:
Gitlab
::
Json
.
parse
(
response
.
body
)[
'token'
])
else
error
(
'Expected 200 response code for an access token'
,
response
.
code
)
end
...
...
ee/app/services/fetch_subscription_plans_service.rb
View file @
5176313c
...
...
@@ -19,7 +19,7 @@ class FetchSubscriptionPlansService
query:
{
plan:
@plan
},
headers:
{
'Accept'
=>
'application/json'
})
JSON
.
parse
(
response
.
body
).
map
{
|
plan
|
Hashie
::
Mash
.
new
(
plan
)
}
Gitlab
::
Json
.
parse
(
response
.
body
).
map
{
|
plan
|
Hashie
::
Mash
.
new
(
plan
)
}
rescue
=>
e
Rails
.
logger
.
info
"Unable to connect to GitLab Customers App
#{
e
}
"
# rubocop:disable Gitlab/RailsLogger
...
...
ee/app/services/geo/container_repository_sync.rb
View file @
5176313c
...
...
@@ -30,7 +30,7 @@ module Geo
def
sync_tag
(
tag
)
file
=
nil
manifest
=
client
.
repository_raw_manifest
(
name
,
tag
)
manifest_parsed
=
JSON
.
parse
(
manifest
)
manifest_parsed
=
Gitlab
::
Json
.
parse
(
manifest
)
list_blobs
(
manifest_parsed
).
each
do
|
digest
|
next
if
container_repository
.
blob_exists?
(
digest
)
...
...
ee/db/fixtures/development/26_packages.rb
View file @
5176313c
...
...
@@ -16,8 +16,7 @@ class Gitlab::Seeder::Packages
name
=
"@
#{
@project
.
root_namespace
.
path
}
/npm_package_
#{
SecureRandom
.
hex
}
"
version
=
"1.12.
#{
i
}
"
params
=
JSON
.
parse
(
read_fixture_file
(
'npm'
,
'payload.json'
)
params
=
Gitlab
::
Json
.
parse
(
read_fixture_file
(
'npm'
,
'payload.json'
)
.
gsub
(
'@root/npm-test'
,
name
)
.
gsub
(
'1.0.1'
,
version
))
.
with_indifferent_access
...
...
ee/lib/gitlab/ci/parsers/license_compliance/license_scanning.rb
View file @
5176313c
...
...
@@ -10,7 +10,7 @@ module Gitlab
PARSERS
=
{
'1'
=>
V1
,
'2'
=>
V2
}.
freeze
def
parse!
(
json_data
,
report
)
json
=
JSON
.
parse
(
json_data
,
symbolize_names:
true
,
object_class:
Hash
)
json
=
Gitlab
::
Json
.
parse
(
json_data
,
symbolize_names:
true
,
object_class:
Hash
)
return
unless
json
.
is_a?
(
Hash
)
report
.
version
=
json
[
:version
].
presence
||
DEFAULT_VERSION
...
...
ee/lib/gitlab/ci/parsers/security/common.rb
View file @
5176313c
...
...
@@ -24,7 +24,7 @@ module Gitlab
protected
def
parse_report
(
json_data
)
JSON
.
parse!
(
json_data
)
Gitlab
::
Json
.
parse!
(
json_data
)
end
# map remediations to relevant vulnerabilities
...
...
ee/lib/gitlab/ci/parsers/security/dependency_list.rb
View file @
5176313c
...
...
@@ -10,7 +10,7 @@ module Gitlab
end
def
parse!
(
json_data
,
report
)
report_data
=
JSON
.
parse
(
json_data
)
report_data
=
Gitlab
::
Json
.
parse
(
json_data
)
report_data
.
fetch
(
'dependency_files'
,
[]).
each
do
|
file
|
file
[
'dependencies'
].
each
do
|
dependency
|
report
.
add_dependency
(
formatter
.
format
(
dependency
,
...
...
ee/lib/gitlab/ci/parsers/security/scanned_resources.rb
View file @
5176313c
...
...
@@ -16,7 +16,7 @@ module Gitlab
private
def
parse_report_json
(
blob
)
JSON
.
parse!
(
blob
)
Gitlab
::
Json
.
parse!
(
blob
)
rescue
JSON
::
ParserError
{}
end
...
...
ee/lib/gitlab/geo/jwt_request_decoder.rb
View file @
5176313c
...
...
@@ -70,7 +70,7 @@ module Gitlab
)
message
=
decoded
.
first
data
=
JSON
.
parse
(
message
[
'data'
])
if
message
data
=
Gitlab
::
Json
.
parse
(
message
[
'data'
])
if
message
data
&
.
deep_symbolize_keys!
data
rescue
JWT
::
ImmatureSignature
,
JWT
::
ExpiredSignature
...
...
ee/lib/gitlab/spdx/catalogue_gateway.rb
View file @
5176313c
...
...
@@ -22,7 +22,7 @@ module Gitlab
private
def
parse
(
json
)
build_catalogue
(
JSON
.
parse
(
json
,
symbolize_names:
true
))
build_catalogue
(
Gitlab
::
Json
.
parse
(
json
,
symbolize_names:
true
))
end
def
record_failure
(
tags
=
{})
...
...
ee/spec/controllers/projects/pipelines_controller_spec.rb
View file @
5176313c
...
...
@@ -74,7 +74,7 @@ describe Projects::PipelinesController do
let!
(
:mit_license
)
{
create
(
:software_license
,
:mit
)
}
let!
(
:software_license_policy
)
{
create
(
:software_license_policy
,
software_license:
mit_license
,
project:
project
)
}
let
(
:payload
)
{
JSON
.
parse
(
licenses_with_json
.
body
)
}
let
(
:payload
)
{
Gitlab
::
Json
.
parse
(
licenses_with_json
.
body
)
}
context
'with a license scanning artifact'
do
before
do
...
...
ee/spec/controllers/projects/service_desk_controller_spec.rb
View file @
5176313c
...
...
@@ -48,7 +48,7 @@ describe Projects::ServiceDeskController do
get
:show
,
params:
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
},
format: :json
response_hash
=
JSON
.
parse
(
response
.
body
)
response_hash
=
Gitlab
::
Json
.
parse
(
response
.
body
)
expect
(
response_hash
[
'template_file_missing'
]).
to
eq
(
false
)
end
end
...
...
ee/spec/factories/spdx_catalogue.rb
View file @
5176313c
...
...
@@ -4,7 +4,7 @@ FactoryBot.define do
factory
:spdx_catalogue
,
class:
'::Gitlab::SPDX::Catalogue'
do
initialize_with
do
content
=
IO
.
read
(
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'spdx.json'
))
::
Gitlab
::
SPDX
::
Catalogue
.
new
(
JSON
.
parse
(
content
,
symbolize_names:
true
))
::
Gitlab
::
SPDX
::
Catalogue
.
new
(
Gitlab
::
Json
.
parse
(
content
,
symbolize_names:
true
))
end
end
end
ee/spec/factories/vulnerabilities/occurrences.rb
View file @
5176313c
...
...
@@ -12,7 +12,7 @@ FactoryBot.define do
after
(
:build
)
do
|
finding
,
evaluator
|
if
evaluator
.
summary
raw_metadata
=
JSON
.
parse
(
finding
.
raw_metadata
)
raw_metadata
=
Gitlab
::
Json
.
parse
(
finding
.
raw_metadata
)
raw_metadata
.
delete
(
"solution"
)
raw_metadata
[
"remediations"
]
=
[
{
...
...
@@ -93,7 +93,7 @@ FactoryBot.define do
trait
:with_remediation
do
after
(
:build
)
do
|
finding
|
raw_metadata
=
JSON
.
parse
(
finding
.
raw_metadata
)
raw_metadata
=
Gitlab
::
Json
.
parse
(
finding
.
raw_metadata
)
raw_metadata
.
delete
(
:solution
)
raw_metadata
[
:remediations
]
=
[
{
...
...
ee/spec/features/billings/billing_plans_spec.rb
View file @
5176313c
...
...
@@ -12,7 +12,7 @@ describe 'Billing plan pages', :feature do
let
(
:silver_plan
)
{
create
(
:silver_plan
)
}
let
(
:gold_plan
)
{
create
(
:gold_plan
)
}
let
(
:plans_data
)
do
JSON
.
parse
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/gitlab_com_plans.json'
))).
map
do
|
data
|
Gitlab
::
Json
.
parse
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/gitlab_com_plans.json'
))).
map
do
|
data
|
data
.
deep_symbolize_keys
end
end
...
...
ee/spec/features/projects/licenses/maintainer_views_policies_spec.rb
View file @
5176313c
...
...
@@ -29,7 +29,7 @@ describe 'EE > Projects > Licenses > Maintainer views policies', :js do
let_it_be
(
:mit
)
{
create
(
:software_license
,
:mit
)
}
let_it_be
(
:mit_policy
)
{
create
(
:software_license_policy
,
:denied
,
software_license:
mit
,
project:
project
)
}
let_it_be
(
:pipeline
)
{
create
(
:ee_ci_pipeline
,
project:
project
,
builds:
[
create
(
:ee_ci_build
,
:license_scan_v2
,
:success
)])
}
let
(
:report
)
{
JSON
.
parse
(
fixture_file
(
'security_reports/gl-license-scanning-report-v2.json'
,
dir:
'ee'
))
}
let
(
:report
)
{
Gitlab
::
Json
.
parse
(
fixture_file
(
'security_reports/gl-license-scanning-report-v2.json'
,
dir:
'ee'
))
}
let
(
:known_licenses
)
{
report
[
'licenses'
].
find_all
{
|
license
|
license
[
'url'
].
present?
}
}
it
'displays licenses detected in the most recent scan report'
do
...
...
ee/spec/features/trials/show_trial_banner_spec.rb
View file @
5176313c
...
...
@@ -9,7 +9,7 @@ describe 'Show trial banner', :js do
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:gold_plan
)
{
create
(
:gold_plan
)
}
let
(
:plans_data
)
do
JSON
.
parse
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/gitlab_com_plans.json'
))).
map
do
|
data
|
Gitlab
::
Json
.
parse
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/gitlab_com_plans.json'
))).
map
do
|
data
|
data
.
deep_symbolize_keys
end
end
...
...
ee/spec/finders/security/pipeline_vulnerabilities_finder_spec.rb
View file @
5176313c
...
...
@@ -299,7 +299,7 @@ describe Security::PipelineVulnerabilitiesFinder do
end
def
read_fixture
(
fixture
)
JSON
.
parse
(
File
.
read
(
fixture
.
file
.
path
))
Gitlab
::
Json
.
parse
(
File
.
read
(
fixture
.
file
.
path
))
end
end
end
...
...
ee/spec/finders/status_page/incident_comments_finder_spec.rb
View file @
5176313c
...
...
@@ -47,7 +47,7 @@ describe StatusPage::IncidentCommentsFinder do
describe
'award emoji'
do
let
(
:digest_path
)
{
Rails
.
root
.
join
(
*
%w[fixtures emojis digests.json]
)
}
let
(
:digest_json
)
{
JSON
.
parse
(
File
.
read
(
digest_path
))
}
let
(
:digest_json
)
{
Gitlab
::
Json
.
parse
(
File
.
read
(
digest_path
))
}
it
'ensures that emoji exists'
do
expect
(
digest_json
).
to
include
(
visible_emoji
)
...
...
ee/spec/graphql/types/vulnerability_type_spec.rb
View file @
5176313c
...
...
@@ -84,7 +84,7 @@ describe GitlabSchema.types['Vulnerability'] do
it
"is the JSON metadata for the vulnerability's location"
do
vulnerabilities
=
subject
.
dig
(
'data'
,
'project'
,
'vulnerabilities'
,
'nodes'
)
expect
(
JSON
.
parse
(
vulnerabilities
.
first
[
'location'
])).
to
eq
(
location
)
expect
(
Gitlab
::
Json
.
parse
(
vulnerabilities
.
first
[
'location'
])).
to
eq
(
location
)
end
end
end
ee/spec/helpers/vulnerabilities_helper_spec.rb
View file @
5176313c
...
...
@@ -74,7 +74,7 @@ describe VulnerabilitiesHelper do
describe
'when pipeline exists'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:pipelineData
)
{
JSON
.
parse
(
subject
[
:pipeline_json
])
}
let
(
:pipelineData
)
{
Gitlab
::
Json
.
parse
(
subject
[
:pipeline_json
])
}
include_examples
'vulnerability properties'
...
...
ee/spec/lib/ee/api/helpers_spec.rb
View file @
5176313c
...
...
@@ -41,7 +41,7 @@ describe EE::API::Helpers do
get
'user'
expect
(
JSON
.
parse
(
last_response
.
body
)).
to
eq
({
'id'
=>
user
.
id
})
expect
(
Gitlab
::
Json
.
parse
(
last_response
.
body
)).
to
eq
({
'id'
=>
user
.
id
})
end
it
'does not handle sticking if no user could be found'
do
...
...
@@ -52,7 +52,7 @@ describe EE::API::Helpers do
get
'user'
expect
(
JSON
.
parse
(
last_response
.
body
)).
to
eq
({
'found'
=>
false
})
expect
(
Gitlab
::
Json
.
parse
(
last_response
.
body
)).
to
eq
({
'found'
=>
false
})
end
it
'returns the user if one could be found'
do
...
...
@@ -60,7 +60,7 @@ describe EE::API::Helpers do
get
'user'
expect
(
JSON
.
parse
(
last_response
.
body
)).
to
eq
({
'id'
=>
user
.
id
})
expect
(
Gitlab
::
Json
.
parse
(
last_response
.
body
)).
to
eq
({
'id'
=>
user
.
id
})
end
end
...
...
@@ -71,7 +71,7 @@ describe EE::API::Helpers do
header
'Authorization'
,
'test'
get
'protected'
,
params:
{
current_user:
'test'
}
expect
(
JSON
.
parse
(
last_response
.
body
)).
to
eq
({
'message'
=>
'Gitlab::Geo::InvalidDecryptionKeyError'
})
expect
(
Gitlab
::
Json
.
parse
(
last_response
.
body
)).
to
eq
({
'message'
=>
'Gitlab::Geo::InvalidDecryptionKeyError'
})
end
it
'rescues from ::Gitlab::Geo::InvalidSignatureTimeError'
do
...
...
@@ -80,7 +80,7 @@ describe EE::API::Helpers do
header
'Authorization'
,
'test'
get
'protected'
,
params:
{
current_user:
'test'
}
expect
(
JSON
.
parse
(
last_response
.
body
)).
to
eq
({
'message'
=>
'Gitlab::Geo::InvalidSignatureTimeError'
})
expect
(
Gitlab
::
Json
.
parse
(
last_response
.
body
)).
to
eq
({
'message'
=>
'Gitlab::Geo::InvalidSignatureTimeError'
})
end
it
'returns unauthorized response when scope is not valid'
do
...
...
@@ -89,7 +89,7 @@ describe EE::API::Helpers do
header
'Authorization'
,
'test'
get
'protected'
,
params:
{
current_user:
'test'
}
expect
(
JSON
.
parse
(
last_response
.
body
)).
to
eq
({
'message'
=>
'401 Unauthorized'
})
expect
(
Gitlab
::
Json
.
parse
(
last_response
.
body
)).
to
eq
({
'message'
=>
'401 Unauthorized'
})
end
end
...
...
ee/spec/lib/ee/gitlab/import_export/group/tree_saver_spec.rb
View file @
5176313c
...
...
@@ -180,7 +180,7 @@ describe Gitlab::ImportExport::Group::TreeSaver do
def
read_association
(
group
,
association
)
path
=
exported_path_for
(
File
.
join
(
"
#{
group
.
id
}
"
,
"
#{
association
}
.ndjson"
))
File
.
foreach
(
path
).
map
{
|
line
|
JSON
.
parse
(
line
)
}
File
.
foreach
(
path
).
map
{
|
line
|
Gitlab
::
Json
.
parse
(
line
)
}
end
def
expect_successful_save
(
group_tree_saver
)
...
...
ee/spec/lib/gitlab/ci/parsers/license_compliance/license_scanning_spec.rb
View file @
5176313c
...
...
@@ -130,14 +130,14 @@ describe Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning do
context
'when the report version is not recognized'
do
it
do
expect
do
subject
.
parse!
(
JSON
.
pretty_generate
({
version:
'x'
}),
report
)
subject
.
parse!
(
Gitlab
::
Json
.
pretty_generate
({
version:
'x'
}),
report
)
end
.
to
raise_error
(
KeyError
)
end
end
context
'when the report version is missing'
do
before
do
subject
.
parse!
(
JSON
.
pretty_generate
({}),
report
)
subject
.
parse!
(
Gitlab
::
Json
.
pretty_generate
({}),
report
)
end
it
{
expect
(
report
.
version
).
to
eq
(
'1.0'
)
}
...
...
@@ -146,7 +146,7 @@ describe Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning do
context
'when the report version is nil'
do
before
do
subject
.
parse!
(
JSON
.
pretty_generate
({
version:
nil
}),
report
)
subject
.
parse!
(
Gitlab
::
Json
.
pretty_generate
({
version:
nil
}),
report
)
end
it
{
expect
(
report
.
version
).
to
eq
(
'1.0'
)
}
...
...
@@ -155,7 +155,7 @@ describe Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning do
context
'when the report version is blank'
do
before
do
subject
.
parse!
(
JSON
.
pretty_generate
({
version:
''
}),
report
)
subject
.
parse!
(
Gitlab
::
Json
.
pretty_generate
({
version:
''
}),
report
)
end
it
{
expect
(
report
.
version
).
to
eq
(
'1.0'
)
}
...
...
@@ -163,7 +163,7 @@ describe Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning do
end
context
'when the report is structured as an array'
do
let
(
:invalid_json
)
{
JSON
.
pretty_generate
([])
}
let
(
:invalid_json
)
{
Gitlab
::
Json
.
pretty_generate
([])
}
before
do
subject
.
parse!
(
invalid_json
,
report
)
...
...
ee/spec/lib/gitlab/ci/parsers/security/container_scanning_spec.rb
View file @
5176313c
...
...
@@ -48,7 +48,7 @@ describe Gitlab::Ci::Parsers::Security::ContainerScanning do
end
it
"adds report image's name to raw_metadata"
do
expect
(
JSON
.
parse
(
report
.
occurrences
.
first
.
raw_metadata
).
dig
(
'location'
,
'image'
)).
to
eq
(
image
)
expect
(
Gitlab
::
Json
.
parse
(
report
.
occurrences
.
first
.
raw_metadata
).
dig
(
'location'
,
'image'
)).
to
eq
(
image
)
end
end
end
...
...
ee/spec/lib/gitlab/ci/parsers/security/dependency_scanning_spec.rb
View file @
5176313c
...
...
@@ -50,7 +50,7 @@ describe Gitlab::Ci::Parsers::Security::DependencyScanning do
end
context
"when parsing a vulnerability with a missing location"
do
let
(
:report_hash
)
{
JSON
.
parse
(
fixture_file
(
'security_reports/master/gl-sast-report.json'
,
dir:
'ee'
),
symbolize_names:
true
)
}
let
(
:report_hash
)
{
Gitlab
::
Json
.
parse
(
fixture_file
(
'security_reports/master/gl-sast-report.json'
,
dir:
'ee'
),
symbolize_names:
true
)
}
before
do
report_hash
[
:vulnerabilities
][
0
][
:location
]
=
nil
...
...
@@ -60,7 +60,7 @@ describe Gitlab::Ci::Parsers::Security::DependencyScanning do
end
context
"when parsing a vulnerability with a missing cve"
do
let
(
:report_hash
)
{
JSON
.
parse
(
fixture_file
(
'security_reports/master/gl-sast-report.json'
,
dir:
'ee'
),
symbolize_names:
true
)
}
let
(
:report_hash
)
{
Gitlab
::
Json
.
parse
(
fixture_file
(
'security_reports/master/gl-sast-report.json'
,
dir:
'ee'
),
symbolize_names:
true
)
}
before
do
report_hash
[
:vulnerabilities
][
0
][
:cve
]
=
nil
...
...
@@ -80,7 +80,7 @@ describe Gitlab::Ci::Parsers::Security::DependencyScanning do
it
"generates occurrence with expected remediation"
do
occurrence
=
report
.
occurrences
.
last
raw_metadata
=
JSON
.
parse!
(
occurrence
.
raw_metadata
)
raw_metadata
=
Gitlab
::
Json
.
parse!
(
occurrence
.
raw_metadata
)
expect
(
occurrence
.
name
).
to
eq
(
"Authentication bypass via incorrect DOM traversal and canonicalization in saml2-js"
)
expect
(
raw_metadata
[
"remediations"
].
first
[
"summary"
]).
to
eq
(
"Upgrade saml2-js"
)
...
...
ee/spec/lib/gitlab/ci/parsers/security/formatters/dast_spec.rb
View file @
5176313c
...
...
@@ -6,11 +6,9 @@ describe Gitlab::Ci::Parsers::Security::Formatters::Dast do
let
(
:formatter
)
{
described_class
.
new
(
parsed_report
)
}
let
(
:parsed_report
)
do
JSON
.
parse!
(
File
.
read
(
Gitlab
::
Json
.
parse!
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/security_reports/deprecated/gl-dast-report-no-common-fields.json'
)
)
)
))
end
describe
'#format_vulnerability'
do
...
...
ee/spec/lib/gitlab/ci/parsers/security/formatters/dependency_list_spec.rb
View file @
5176313c
...
...
@@ -8,11 +8,9 @@ describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do
let
(
:sha
)
{
'4242424242424242'
}
let
(
:parsed_report
)
do
JSON
.
parse!
(
File
.
read
(
Gitlab
::
Json
.
parse!
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/security_reports/dependency_list/gl-dependency-scanning-report.json'
)
)
)
))
end
describe
'#format'
do
...
...
ee/spec/lib/gitlab/ci/parsers/security/formatters/deprecated_container_scanning_spec.rb
View file @
5176313c
...
...
@@ -7,11 +7,9 @@ describe Gitlab::Ci::Parsers::Security::Formatters::DeprecatedContainerScanning
describe
'#format'
do
let
(
:raw_report
)
do
JSON
.
parse!
(
File
.
read
(
Gitlab
::
Json
.
parse!
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/security_reports/deprecated/gl-container-scanning-report.json'
)
)
)
))
end
it
'formats the vulnerability into the 1.3 format'
do
...
...
ee/spec/lib/gitlab/ci/parsers/security/formatters/deprecated_formatted_container_scanning_vulnerability_spec.rb
View file @
5176313c
...
...
@@ -4,11 +4,9 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Parsers
::
Security
::
Formatters
::
DeprecatedFormattedContainerScanningVulnerability
do
let
(
:raw_report
)
do
JSON
.
parse!
(
File
.
read
(
Gitlab
::
Json
.
parse!
(
File
.
read
(
Rails
.
root
.
join
(
'ee/spec/fixtures/security_reports/deprecated/gl-container-scanning-report.json'
)
)
)
))
end
let
(
:vulnerability
)
{
raw_report
[
'vulnerabilities'
].
first
}
...
...
ee/spec/lib/gitlab/ci/parsers/security/sast_spec.rb
View file @
5176313c
...
...
@@ -49,7 +49,7 @@ describe Gitlab::Ci::Parsers::Security::Sast do
context
"when parsing an empty report"
do
let
(
:report
)
{
Gitlab
::
Ci
::
Reports
::
Security
::
Report
.
new
(
'sast'
,
commit_sha
,
created_at
)
}
let
(
:blob
)
{
JSON
.
generate
({})
}
let
(
:blob
)
{
Gitlab
::
Json
.
generate
({})
}
it
{
expect
(
parser
.
parse!
(
blob
,
report
)).
to
be_empty
}
end
...
...
ee/spec/lib/gitlab/database/load_balancing/srv_resolver_spec.rb
View file @
5176313c
...
...
@@ -53,7 +53,7 @@ describe Gitlab::Database::LoadBalancing::SrvResolver do
def
dns_response_packet_from_fixture
(
fixture_name
)
fixture
=
File
.
read
(
Rails
.
root
+
"ee/spec/fixtures/dns/
#{
fixture_name
}
.json"
)
encoded_payload
=
JSON
.
parse
(
fixture
)[
'payload'
]
encoded_payload
=
Gitlab
::
Json
.
parse
(
fixture
)[
'payload'
]
payload
=
Base64
.
decode64
(
encoded_payload
)
Net
::
DNS
::
Packet
.
parse
(
payload
)
...
...
ee/spec/lib/gitlab/geo/oauth/session_spec.rb
View file @
5176313c
...
...
@@ -34,7 +34,7 @@ describe Gitlab::Geo::Oauth::Session, :geo do
end
it
'returns hashed user data'
do
parsed_json
=
JSON
.
parse
(
user_json
)
parsed_json
=
Gitlab
::
Json
.
parse
(
user_json
)
expect
(
subject
.
authenticate
(
access_token
.
token
)).
to
eq
(
parsed_json
)
end
...
...
ee/spec/lib/gitlab/spdx/catalogue_gateway_spec.rb
View file @
5176313c
...
...
@@ -11,7 +11,7 @@ describe Gitlab::SPDX::CatalogueGateway do
context
"when the licenses.json endpoint is healthy"
do
let
(
:spdx_json
)
{
IO
.
read
(
Rails
.
root
.
join
(
"spec"
,
"fixtures"
,
"spdx.json"
))
}
let
(
:catalogue_hash
)
{
JSON
.
parse
(
spdx_json
,
symbolize_names:
true
)
}
let
(
:catalogue_hash
)
{
Gitlab
::
Json
.
parse
(
spdx_json
,
symbolize_names:
true
)
}
before
do
stub_full_request
(
url
,
method: :get
).
to_return
(
status:
200
,
body:
spdx_json
)
...
...
ee/spec/lib/gitlab/spdx/catalogue_spec.rb
View file @
5176313c
...
...
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::SPDX::Catalogue do
subject
{
described_class
.
new
(
catalogue_hash
)
}
let
(
:spdx_json
)
{
IO
.
read
(
Rails
.
root
.
join
(
"spec"
,
"fixtures"
,
"spdx.json"
))
}
let
(
:catalogue_hash
)
{
JSON
.
parse
(
spdx_json
,
symbolize_names:
true
)
}
let
(
:catalogue_hash
)
{
Gitlab
::
Json
.
parse
(
spdx_json
,
symbolize_names:
true
)
}
describe
"#version"
do
let
(
:version
)
{
SecureRandom
.
uuid
}
...
...
ee/spec/presenters/epic_presenter_spec.rb
View file @
5176313c
...
...
@@ -30,7 +30,7 @@ describe EpicPresenter do
end
it
'has correct ancestors'
do
metadata
=
JSON
.
parse
(
presenter
.
show_data
[
:meta
])
metadata
=
Gitlab
::
Json
.
parse
(
presenter
.
show_data
[
:meta
])
ancestor_url
=
metadata
[
'ancestors'
].
first
[
'url'
]
expect
(
ancestor_url
).
to
eq
"/groups/
#{
parent_epic
.
group
.
full_path
}
/-/epics/
#{
parent_epic
.
iid
}
"
...
...
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
View file @
5176313c
...
...
@@ -37,7 +37,7 @@ describe Projects::Security::ConfigurationPresenter do
end
it
'reports that all security jobs are configured'
do
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
expect
(
Gitlab
::
Json
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
true
),
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
true
),
...
...
@@ -57,7 +57,7 @@ describe Projects::Security::ConfigurationPresenter do
end
it
'reports all security jobs as unconfigured'
do
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
expect
(
Gitlab
::
Json
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
false
),
security_scan
(
:sast
,
configured:
false
),
security_scan
(
:container_scanning
,
configured:
false
),
...
...
@@ -83,7 +83,7 @@ describe Projects::Security::ConfigurationPresenter do
end
it
'uses the latest default branch pipeline to determine whether a security job is configured'
do
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
expect
(
Gitlab
::
Json
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
true
),
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
...
...
@@ -97,7 +97,7 @@ describe Projects::Security::ConfigurationPresenter do
create
(
:ci_build
,
:sast
,
pipeline:
pipeline
)
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
expect
(
Gitlab
::
Json
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
false
),
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
...
...
@@ -117,7 +117,7 @@ describe Projects::Security::ConfigurationPresenter do
subject
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
expect
(
Gitlab
::
Json
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
false
),
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
...
...
@@ -129,7 +129,7 @@ describe Projects::Security::ConfigurationPresenter do
it
'detect new license compliance job'
do
create
(
:ci_build
,
:license_scanning
,
pipeline:
pipeline
)
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
expect
(
Gitlab
::
Json
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
true
),
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
...
...
ee/spec/requests/api/feature_flag_scopes_spec.rb
View file @
5176313c
...
...
@@ -158,7 +158,7 @@ describe API::FeatureFlagScopes do
expect
(
response
).
to
match_response_schema
(
'public_api/v4/feature_flag_scope'
,
dir:
'ee'
)
expect
(
json_response
[
'environment_scope'
]).
to
eq
(
params
[
:environment_scope
])
expect
(
json_response
[
'active'
]).
to
eq
(
params
[
:active
])
expect
(
json_response
[
'strategies'
]).
to
eq
(
JSON
.
parse
(
params
[
:strategies
]))
expect
(
json_response
[
'strategies'
]).
to
eq
(
Gitlab
::
Json
.
parse
(
params
[
:strategies
]))
end
context
'when the scope already exists'
do
...
...
@@ -258,7 +258,7 @@ describe API::FeatureFlagScopes do
expect
(
response
).
to
match_response_schema
(
'public_api/v4/feature_flag_scope'
,
dir:
'ee'
)
expect
(
json_response
[
'id'
]).
to
eq
(
scope
.
id
)
expect
(
json_response
[
'active'
]).
to
eq
(
params
[
:active
])
expect
(
json_response
[
'strategies'
]).
to
eq
(
JSON
.
parse
(
params
[
:strategies
]))
expect
(
json_response
[
'strategies'
]).
to
eq
(
Gitlab
::
Json
.
parse
(
params
[
:strategies
]))
end
context
'when there are no corresponding feature flag scopes'
do
...
...
ee/spec/requests/api/feature_flags_spec.rb
View file @
5176313c
...
...
@@ -354,7 +354,7 @@ describe API::FeatureFlags do
feature_flag
.
scopes
.
ordered
.
each_with_index
do
|
scope
,
index
|
expect
(
scope
.
environment_scope
).
to
eq
(
params
[
:scopes
][
index
][
:environment_scope
])
expect
(
scope
.
active
).
to
eq
(
params
[
:scopes
][
index
][
:active
])
expect
(
scope
.
strategies
).
to
eq
(
JSON
.
parse
(
params
[
:scopes
][
index
][
:strategies
]))
expect
(
scope
.
strategies
).
to
eq
(
Gitlab
::
Json
.
parse
(
params
[
:scopes
][
index
][
:strategies
]))
end
end
end
...
...
@@ -480,7 +480,7 @@ describe API::FeatureFlags do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/feature_flag'
,
dir:
'ee'
)
expect
(
feature_flag
.
name
).
to
eq
(
params
[
:name
])
expect
(
scope
.
strategies
).
to
eq
([
JSON
.
parse
(
params
[
:strategy
])])
expect
(
scope
.
strategies
).
to
eq
([
Gitlab
::
Json
.
parse
(
params
[
:strategy
])])
expect
(
feature_flag
.
version
).
to
eq
(
'legacy_flag'
)
end
...
...
@@ -507,7 +507,7 @@ describe API::FeatureFlags do
scope
=
feature_flag
.
scopes
.
find_by_environment_scope
(
params
[
:environment_scope
])
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
scope
.
strategies
).
to
eq
([
JSON
.
parse
(
params
[
:strategy
])])
expect
(
scope
.
strategies
).
to
eq
([
Gitlab
::
Json
.
parse
(
params
[
:strategy
])])
end
it_behaves_like
'check user permission'
...
...
@@ -525,11 +525,11 @@ describe API::FeatureFlags do
scope
=
feature_flag
.
scopes
.
find_by_environment_scope
(
params
[
:environment_scope
])
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
scope
.
strategies
).
to
eq
([
defined_strategy
.
deep_stringify_keys
,
JSON
.
parse
(
params
[
:strategy
])])
expect
(
scope
.
strategies
).
to
eq
([
defined_strategy
.
deep_stringify_keys
,
Gitlab
::
Json
.
parse
(
params
[
:strategy
])])
end
context
'when the specified strategy exists already'
do
let
(
:defined_strategy
)
{
JSON
.
parse
(
params
[
:strategy
])
}
let
(
:defined_strategy
)
{
Gitlab
::
Json
.
parse
(
params
[
:strategy
])
}
it
'does not add a duplicate strategy'
do
subject
...
...
ee/spec/requests/api/graphql/boards/board_lists_query_spec.rb
View file @
5176313c
...
...
@@ -149,6 +149,6 @@ describe 'get board lists' do
end
def
grab_list_data
(
response_body
)
JSON
.
parse
(
response_body
)[
'data'
][
board_parent_type
][
'boards'
][
'edges'
][
0
][
'node'
][
'lists'
][
'edges'
]
Gitlab
::
Json
.
parse
(
response_body
)[
'data'
][
board_parent_type
][
'boards'
][
'edges'
][
0
][
'node'
][
'lists'
][
'edges'
]
end
end
ee/spec/requests/api/graphql/project/issue/design_collection/version_spec.rb
View file @
5176313c
...
...
@@ -188,7 +188,7 @@ describe 'Query.project(fullPath).issue(iid).designCollection.version(sha)' do
post_graphql
(
cursored_query
,
current_user:
current_user
)
new_data
=
JSON
.
parse
(
response
.
body
).
fetch
(
'data'
)
new_data
=
Gitlab
::
Json
.
parse
(
response
.
body
).
fetch
(
'data'
)
expect
(
response_values
(
new_data
)).
to
match_array
(
ids
.
drop
(
2
))
end
...
...
ee/spec/requests/api/graphql/project/issue/design_collection/versions_spec.rb
View file @
5176313c
...
...
@@ -105,7 +105,7 @@ describe 'Getting versions related to an issue' do
post_graphql
(
cursored_query
,
current_user:
current_user
)
new_data
=
JSON
.
parse
(
response
.
body
).
fetch
(
'data'
)
new_data
=
Gitlab
::
Json
.
parse
(
response
.
body
).
fetch
(
'data'
)
expect
(
response_values
(
new_data
)).
to
match_array
(
ids
.
drop
(
2
))
end
...
...
ee/spec/requests/api/graphql/project/issue/designs/designs_spec.rb
View file @
5176313c
...
...
@@ -114,7 +114,7 @@ describe 'Getting designs related to an issue' do
post_graphql
(
cursored_query
,
current_user:
current_user
)
new_data
=
JSON
.
parse
(
response
.
body
).
fetch
(
'data'
)
new_data
=
Gitlab
::
Json
.
parse
(
response
.
body
).
fetch
(
'data'
)
expect
(
response_ids
(
new_data
)).
to
match_array
(
ids
.
drop
(
2
))
end
...
...
ee/spec/requests/api/graphql/project/requirements_spec.rb
View file @
5176313c
...
...
@@ -107,7 +107,7 @@ describe 'getting a requirement list for a project' do
cursored_query
=
query
(
"sort:
#{
sort_by
}
, after:
\"
#{
end_cursor
}
\"
"
)
post_graphql
(
cursored_query
,
current_user:
current_user
)
JSON
.
parse
(
response
.
body
)[
'data'
][
'project'
][
'requirements'
][
'edges'
]
Gitlab
::
Json
.
parse
(
response
.
body
)[
'data'
][
'project'
][
'requirements'
][
'edges'
]
end
before
do
...
...
ee/spec/requests/api/npm_packages_spec.rb
View file @
5176313c
...
...
@@ -395,8 +395,7 @@ describe API::NpmPackages do
end
def
upload_params
(
package_name
:,
package_version:
'1.0.1'
,
file:
'npm/payload.json'
)
JSON
.
parse
(
fixture_file
(
file
,
dir:
'ee'
)
Gitlab
::
Json
.
parse
(
fixture_file
(
file
,
dir:
'ee'
)
.
gsub
(
'@root/npm-test'
,
package_name
)
.
gsub
(
'1.0.1'
,
package_version
))
end
...
...
ee/spec/services/geo/container_repository_sync_spec.rb
View file @
5176313c
...
...
@@ -31,7 +31,7 @@ describe Geo::ContainerRepositorySync, :geo do
})
.
to_return
(
status:
200
,
body:
JSON
.
dump
(
tags:
%w(obsolete)
),
body:
Gitlab
::
Json
.
dump
(
tags:
%w(obsolete)
),
headers:
{
'Content-Type'
=>
'application/json'
})
stub_request
(
:get
,
"http://primary.registry.gitlab/v2/group/test/my_image/tags/list"
)
...
...
@@ -39,7 +39,7 @@ describe Geo::ContainerRepositorySync, :geo do
headers:
{
'Authorization'
=>
'bearer pull-token'
})
.
to_return
(
status:
200
,
body:
JSON
.
dump
(
tags:
%w(tag-to-sync)
),
body:
Gitlab
::
Json
.
dump
(
tags:
%w(tag-to-sync)
),
headers:
{
'Content-Type'
=>
'application/json'
})
stub_request
(
:head
,
"http://primary.registry.gitlab/v2/group/test/my_image/manifests/tag-to-sync"
)
...
...
ee/spec/services/packages/create_dependency_service_spec.rb
View file @
5176313c
...
...
@@ -10,7 +10,7 @@ describe Packages::CreateDependencyService do
context
'when packages are published'
do
let
(
:json_file
)
{
'npm/payload.json'
}
let
(
:params
)
do
JSON
.
parse
(
fixture_file
(
json_file
,
dir:
'ee'
)
Gitlab
::
Json
.
parse
(
fixture_file
(
json_file
,
dir:
'ee'
)
.
gsub
(
'@root/npm-test'
,
package_name
)
.
gsub
(
'1.0.1'
,
version
))
.
with_indifferent_access
...
...
ee/spec/services/packages/npm/create_package_service_spec.rb
View file @
5176313c
...
...
@@ -8,11 +8,9 @@ describe Packages::Npm::CreatePackageService do
let
(
:version
)
{
'1.0.1'
}
let
(
:params
)
do
JSON
.
parse
(
fixture_file
(
'npm/payload.json'
,
dir:
'ee'
)
Gitlab
::
Json
.
parse
(
fixture_file
(
'npm/payload.json'
,
dir:
'ee'
)
.
gsub
(
'@root/npm-test'
,
package_name
)
.
gsub
(
'1.0.1'
,
version
)
).
with_indifferent_access
.
gsub
(
'1.0.1'
,
version
)).
with_indifferent_access
.
merge!
(
override
)
end
let
(
:override
)
{
{}
}
...
...
ee/spec/services/subscriptions/create_service_spec.rb
View file @
5176313c
...
...
@@ -29,7 +29,7 @@ describe Subscriptions::CreateService do
end
let_it_be
(
:client
)
{
Gitlab
::
SubscriptionPortal
::
Client
}
let_it_be
(
:create_service_params
)
{
JSON
.
parse
(
fixture_file
(
'create_service_params.json'
,
dir:
'ee'
)).
deep_symbolize_keys
}
let_it_be
(
:create_service_params
)
{
Gitlab
::
Json
.
parse
(
fixture_file
(
'create_service_params.json'
,
dir:
'ee'
)).
deep_symbolize_keys
}
describe
'#execute'
do
context
'when failing to create a customer'
do
...
...
ee/spec/support/shared_examples/controllers/cluster_metrics_shared_examples.rb
View file @
5176313c
...
...
@@ -105,7 +105,7 @@ RSpec.shared_examples 'cluster metrics' do
let
(
:prometheus_body
)
{
'{"status":"success"}'
}
it
'returns prometheus response'
do
prometheus_json_body
=
JSON
.
parse
(
prometheus_body
)
prometheus_json_body
=
Gitlab
::
Json
.
parse
(
prometheus_body
)
get
:prometheus_proxy
,
params:
prometheus_proxy_params
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment