mirror of
https://github.com/benbusby/farside.git
synced 2025-04-19 18:38: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)
|
||||
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…
Add table
Reference in a new issue