Test ip rate limiting / throttling

Tests the throttling feature from the previous commit
This commit is contained in:
Ben Busby 2021-11-12 14:37:20 -07:00
parent 2d988a1239
commit 3181bdfc80
No known key found for this signature in database
GPG Key ID: 339B7B7EB5333D14

View File

@ -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