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
21d9ab95
Commit
21d9ab95
authored
Jan 25, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failed rack attack specs
parent
8d8bd3d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
spec/lib/gitlab/rack_attack_spec.rb
spec/lib/gitlab/rack_attack_spec.rb
+3
-0
spec/requests/rack_attack_global_spec.rb
spec/requests/rack_attack_global_spec.rb
+3
-3
No files found.
spec/lib/gitlab/rack_attack_spec.rb
View file @
21d9ab95
...
...
@@ -6,6 +6,7 @@ RSpec.describe Gitlab::RackAttack, :aggregate_failures do
describe
'.configure'
do
let
(
:fake_rack_attack
)
{
class_double
(
"Rack::Attack"
)
}
let
(
:fake_rack_attack_request
)
{
class_double
(
"Rack::Attack::Request"
)
}
let
(
:fake_cache
)
{
instance_double
(
"Rack::Attack::Cache"
)
}
let
(
:throttles
)
do
{
...
...
@@ -27,6 +28,8 @@ RSpec.describe Gitlab::RackAttack, :aggregate_failures do
allow
(
fake_rack_attack
).
to
receive
(
:track
)
allow
(
fake_rack_attack
).
to
receive
(
:safelist
)
allow
(
fake_rack_attack
).
to
receive
(
:blocklist
)
allow
(
fake_rack_attack
).
to
receive
(
:cache
).
and_return
(
fake_cache
)
allow
(
fake_cache
).
to
receive
(
:store
=
)
end
it
'extends the request class'
do
...
...
spec/requests/rack_attack_global_spec.rb
View file @
21d9ab95
...
...
@@ -149,16 +149,16 @@ RSpec.describe 'Rack Attack global throttles' do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
arguments
=
{
arguments
=
a_hash_including
(
{
message:
'Rack_Attack'
,
env: :throttle
,
remote_ip:
'127.0.0.1'
,
request_method:
'GET'
,
path:
'/users/sign_in'
,
matched:
'throttle_unauthenticated'
}
}
)
expect
(
Gitlab
::
AuthLogger
).
to
receive
(
:error
).
with
(
arguments
)
expect
(
Gitlab
::
AuthLogger
).
to
receive
(
:error
).
with
(
arguments
)
.
at_least
(
:once
)
get
url_that_does_not_require_authentication
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