mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 00:27:58 +08:00
Add guard for nil
in our RateLimiter
.
This commit is contained in:
@ -96,7 +96,7 @@ describe RateLimiter do
|
||||
context 'max is less than or equal to zero' do
|
||||
|
||||
it 'should raise the right error' do
|
||||
[-1, 0].each do |max|
|
||||
[-1, 0, nil].each do |max|
|
||||
expect do
|
||||
RateLimiter.new(user, "a", max, 60).performed!
|
||||
end.to raise_error(RateLimiter::LimitExceeded)
|
||||
|
Reference in New Issue
Block a user