mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Add missing test file
This commit is contained in:
parent
793401cc35
commit
58a3d1fa20
24
test/livebook_web/controllers/endpoint_test.exs
Normal file
24
test/livebook_web/controllers/endpoint_test.exs
Normal file
|
@ -0,0 +1,24 @@
|
|||
defmodule LivebookWeb.EndpointTest do
|
||||
use LivebookWeb.ConnCase, async: true
|
||||
|
||||
test "delete cookies once they go over a certain limit", %{conn: conn} do
|
||||
cookies =
|
||||
Enum.map(1..5, &"c#{&1}=#{String.duplicate("a", 4096)}") ++
|
||||
Enum.map(1..5, &"lb:#{&1}=#{String.duplicate("a", 4096)}")
|
||||
|
||||
assert [
|
||||
"c1=;" <> _,
|
||||
"c2=;" <> _,
|
||||
"c3=;" <> _,
|
||||
"c4=;" <> _,
|
||||
"c5=;" <> _,
|
||||
"lb:session" <> _,
|
||||
"lb:user_data" <> _
|
||||
] =
|
||||
conn
|
||||
|> put_req_header("cookie", Enum.join(cookies, "; "))
|
||||
|> get(~p"/")
|
||||
|> get_resp_header("set-cookie")
|
||||
|> Enum.sort()
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue