mirror of
https://github.com/benbusby/farside.git
synced 2025-04-20 10:58:42 +00:00
Test ip rate limiting / throttling
Tests the throttling feature from the previous commit
This commit is contained in:
parent
2d988a1239
commit
3181bdfc80
1 changed files with 14 additions and 0 deletions
|
@ -15,6 +15,20 @@ defmodule FarsideTest do
|
||||||
|> Router.call(@opts)
|
|> Router.call(@opts)
|
||||||
end
|
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
|
test "/" do
|
||||||
conn = test_conn("/")
|
conn = test_conn("/")
|
||||||
assert conn.state == :sent
|
assert conn.state == :sent
|
||||||
|
|
Loading…
Add table
Reference in a new issue