Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
2c3c734b
Unverified
Commit
2c3c734b
authored
2 years ago
by
Nick Schonning
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Autofix Rubocop Style/SymbolProc (#23742)
parent
af4c9510
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.rubocop_todo.yml
+0
-8
0 additions, 8 deletions
.rubocop_todo.yml
spec/lib/request_spec.rb
+4
-4
4 additions, 4 deletions
spec/lib/request_spec.rb
with
4 additions
and
12 deletions
.rubocop_todo.yml
+
0
−
8
View file @
2c3c734b
...
...
@@ -2451,11 +2451,3 @@ Style/SymbolArray:
-
'
spec/controllers/concerns/signature_verification_spec.rb'
-
'
spec/fabricators/notification_fabricator.rb'
-
'
spec/models/public_feed_spec.rb'
# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
# AllowedMethods: define_method, mail, respond_to
Style/SymbolProc
:
Exclude
:
-
'
spec/lib/request_spec.rb'
This diff is collapsed.
Click to expand it.
spec/lib/request_spec.rb
+
4
−
4
View file @
2c3c734b
...
...
@@ -97,12 +97,12 @@ describe Request do
describe
"response's body_with_limit method"
do
it
'rejects body more than 1 megabyte by default'
do
stub_request
(
:any
,
'http://example.com'
).
to_return
(
body:
SecureRandom
.
random_bytes
(
2
.
megabytes
))
expect
{
subject
.
perform
{
|
response
|
response
.
body_with_limit
}
}.
to
raise_error
Mastodon
::
LengthValidationError
expect
{
subject
.
perform
(
&
:
body_with_limit
)
}.
to
raise_error
Mastodon
::
LengthValidationError
end
it
'accepts body less than 1 megabyte by default'
do
stub_request
(
:any
,
'http://example.com'
).
to_return
(
body:
SecureRandom
.
random_bytes
(
2
.
kilobytes
))
expect
{
subject
.
perform
{
|
response
|
response
.
body_with_limit
}
}.
to_not
raise_error
expect
{
subject
.
perform
(
&
:
body_with_limit
)
}.
to_not
raise_error
end
it
'rejects body by given size'
do
...
...
@@ -112,12 +112,12 @@ describe Request do
it
'rejects too large chunked body'
do
stub_request
(
:any
,
'http://example.com'
).
to_return
(
body:
SecureRandom
.
random_bytes
(
2
.
megabytes
),
headers:
{
'Transfer-Encoding'
=>
'chunked'
})
expect
{
subject
.
perform
{
|
response
|
response
.
body_with_limit
}
}.
to
raise_error
Mastodon
::
LengthValidationError
expect
{
subject
.
perform
(
&
:
body_with_limit
)
}.
to
raise_error
Mastodon
::
LengthValidationError
end
it
'rejects too large monolithic body'
do
stub_request
(
:any
,
'http://example.com'
).
to_return
(
body:
SecureRandom
.
random_bytes
(
2
.
megabytes
),
headers:
{
'Content-Length'
=>
2
.
megabytes
})
expect
{
subject
.
perform
{
|
response
|
response
.
body_with_limit
}
}.
to
raise_error
Mastodon
::
LengthValidationError
expect
{
subject
.
perform
(
&
:
body_with_limit
)
}.
to
raise_error
Mastodon
::
LengthValidationError
end
it
'truncates large monolithic body'
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment