Update throttle test to reflect new behavior
The "throttling" performed by Farside now redirects to the same instance as before, rather than outright blocking the connection.
This commit is contained in:
parent
22e9135e0c
commit
1be19a8a29
2 changed files with 9 additions and 6 deletions
|
@ -46,8 +46,6 @@ defmodule Farside.Router do
|
|||
true ->
|
||||
Farside.pick_instance(service)
|
||||
end
|
||||
IO.inspect(get_req_header(conn, "throttle"))
|
||||
IO.inspect(instance)
|
||||
|
||||
params =
|
||||
cond do
|
||||
|
|
|
@ -17,17 +17,22 @@ defmodule FarsideTest do
|
|||
end
|
||||
|
||||
test "throttle" do
|
||||
:get
|
||||
|> conn("/", "")
|
||||
|> Router.call(@opts)
|
||||
first_conn =
|
||||
:get
|
||||
|> conn("/", "")
|
||||
|> Router.call(@opts)
|
||||
|
||||
first_redirect = elem(List.last(first_conn.resp_headers), 1)
|
||||
|
||||
throttled_conn =
|
||||
:get
|
||||
|> conn("/", "")
|
||||
|> Router.call(@opts)
|
||||
|
||||
throttled_redirect = elem(List.last(first_conn.resp_headers), 1)
|
||||
|
||||
assert throttled_conn.state == :sent
|
||||
assert throttled_conn.status == 403
|
||||
assert throttled_redirect == first_redirect
|
||||
end
|
||||
|
||||
test "/" do
|
||||
|
|
Loading…
Add table
Reference in a new issue