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
87fd5bbf
Commit
87fd5bbf
authored
Jan 05, 2021
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rack_attack_global_spec 2.7 warnings
parent
e049419a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
spec/requests/rack_attack_global_spec.rb
spec/requests/rack_attack_global_spec.rb
+6
-6
spec/support/shared_examples/requests/rack_attack_shared_examples.rb
...t/shared_examples/requests/rack_attack_shared_examples.rb
+3
-2
No files found.
spec/requests/rack_attack_global_spec.rb
View file @
87fd5bbf
...
@@ -178,8 +178,8 @@ RSpec.describe 'Rack Attack global throttles' do
...
@@ -178,8 +178,8 @@ RSpec.describe 'Rack Attack global throttles' do
let
(
:api_partial_url
)
{
'/todos'
}
let
(
:api_partial_url
)
{
'/todos'
}
context
'with the token in the query string'
do
context
'with the token in the query string'
do
let
(
:request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
token
)]
}
let
(
:request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
token
)
,
{}
]
}
let
(
:other_user_request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
other_user_token
)]
}
let
(
:other_user_request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
other_user_token
)
,
{}
]
}
it_behaves_like
'rate-limited token-authenticated requests'
it_behaves_like
'rate-limited token-authenticated requests'
end
end
...
@@ -205,8 +205,8 @@ RSpec.describe 'Rack Attack global throttles' do
...
@@ -205,8 +205,8 @@ RSpec.describe 'Rack Attack global throttles' do
let
(
:api_partial_url
)
{
'/todos'
}
let
(
:api_partial_url
)
{
'/todos'
}
context
'with the token in the query string'
do
context
'with the token in the query string'
do
let
(
:request_args
)
{
[
api
(
api_partial_url
,
oauth_access_token:
token
)]
}
let
(
:request_args
)
{
[
api
(
api_partial_url
,
oauth_access_token:
token
)
,
{}
]
}
let
(
:other_user_request_args
)
{
[
api
(
api_partial_url
,
oauth_access_token:
other_user_token
)]
}
let
(
:other_user_request_args
)
{
[
api
(
api_partial_url
,
oauth_access_token:
other_user_token
)
,
{}
]
}
it_behaves_like
'rate-limited token-authenticated requests'
it_behaves_like
'rate-limited token-authenticated requests'
end
end
...
@@ -314,8 +314,8 @@ RSpec.describe 'Rack Attack global throttles' do
...
@@ -314,8 +314,8 @@ RSpec.describe 'Rack Attack global throttles' do
end
end
context
'with the token in the query string'
do
context
'with the token in the query string'
do
let
(
:request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
token
)]
}
let
(
:request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
token
)
,
{}
]
}
let
(
:other_user_request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
other_user_token
)]
}
let
(
:other_user_request_args
)
{
[
api
(
api_partial_url
,
personal_access_token:
other_user_token
)
,
{}
]
}
it_behaves_like
'rate-limited token-authenticated requests'
it_behaves_like
'rate-limited token-authenticated requests'
end
end
...
...
spec/support/shared_examples/requests/rack_attack_shared_examples.rb
View file @
87fd5bbf
...
@@ -154,10 +154,11 @@ RSpec.shared_examples 'rate-limited token-authenticated requests' do
...
@@ -154,10 +154,11 @@ RSpec.shared_examples 'rate-limited token-authenticated requests' do
end
end
def
make_request
(
args
)
def
make_request
(
args
)
path
,
options
=
args
if
request_method
==
'POST'
if
request_method
==
'POST'
post
(
*
arg
s
)
post
(
path
,
**
option
s
)
else
else
get
(
*
arg
s
)
get
(
path
,
**
option
s
)
end
end
end
end
end
end
...
...
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