mirror of
https://github.com/benbusby/farside.git
synced 2025-03-15 03:36:33 -04:00
Test ip rate limiting / throttling
Tests the throttling feature from the previous commit
This commit is contained in:
parent
2d988a1239
commit
3181bdfc80
@ -15,6 +15,20 @@ defmodule FarsideTest do
|
||||
|> Router.call(@opts)
|
||||
end
|
||||
|
||||
test "throttle" do
|
||||
:get
|
||||
|> conn("/", "")
|
||||
|> Router.call(@opts)
|
||||
|
||||
throttled_conn =
|
||||
:get
|
||||
|> conn("/", "")
|
||||
|> Router.call(@opts)
|
||||
|
||||
assert throttled_conn.state == :sent
|
||||
assert throttled_conn.status == 403
|
||||
end
|
||||
|
||||
test "/" do
|
||||
conn = test_conn("/")
|
||||
assert conn.state == :sent
|
||||
|
Loading…
x
Reference in New Issue
Block a user