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
2064506c
Commit
2064506c
authored
Nov 01, 2021
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap contexts in .throttled? describe block
parent
e31ec46d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
spec/lib/gitlab/application_rate_limiter_spec.rb
spec/lib/gitlab/application_rate_limiter_spec.rb
+18
-16
No files found.
spec/lib/gitlab/application_rate_limiter_spec.rb
View file @
2064506c
...
...
@@ -49,30 +49,32 @@ RSpec.describe Gitlab::ApplicationRateLimiter do
end
end
context
'when the key is an array of only ActiveRecord models'
do
let
(
:scope
)
{
[
user
,
project
]
}
describe
'.throttled?'
do
context
'when the key is an array of only ActiveRecord models'
do
let
(
:scope
)
{
[
user
,
project
]
}
let
(
:cache_key
)
do
"application_rate_limiter:test_action:user:
#{
user
.
id
}
:project:
#{
project
.
id
}
"
let
(
:cache_key
)
do
"application_rate_limiter:test_action:user:
#{
user
.
id
}
:project:
#{
project
.
id
}
"
end
it_behaves_like
'action rate limiter'
end
it_behaves_like
'action rate limiter'
end
context
'when they key a combination of ActiveRecord models and strings'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:commit
)
{
project
.
repository
.
commit
}
let
(
:path
)
{
'app/controllers/groups_controller.rb'
}
let
(
:scope
)
{
[
project
,
commit
,
path
]
}
context
'when they key a combination of ActiveRecord models and strings'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:commit
)
{
project
.
repository
.
commit
}
let
(
:path
)
{
'app/controllers/groups_controller.rb'
}
let
(
:scope
)
{
[
project
,
commit
,
path
]
}
let
(
:cache_key
)
do
"application_rate_limiter:test_action:project:
#{
project
.
id
}
:commit:
#{
commit
.
sha
}
:
#{
path
}
"
end
let
(
:cache_key
)
do
"application_rate_limiter:test_action:project:
#{
project
.
id
}
:commit:
#{
commit
.
sha
}
:
#{
path
}
"
it_behaves_like
'action rate limiter'
end
it_behaves_like
'action rate limiter'
end
describe
'
#
log_request'
do
describe
'
.
log_request'
do
let
(
:file_path
)
{
'master/README.md'
}
let
(
:type
)
{
:raw_blob_request_limit
}
let
(
:fullpath
)
{
"/
#{
project
.
full_path
}
/raw/
#{
file_path
}
"
}
...
...
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