Skip to content

Commit fa54827

Browse files
committed
Improve coverage over debug page
1 parent d99f0b5 commit fa54827

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/plug/debugger_test.exs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,15 @@ defmodule Plug.DebuggerTest do
330330
|> put_req_header("accept", "text/html")
331331
|> Plug.Parsers.call(Plug.Parsers.init(parsers: [:urlencoded]))
332332
|> put_req_header("<script>xss-header</script>", "<script>xss-val</script>")
333-
|> render([], fn -> raise "<script>oops</script>" end)
333+
|> render([], fn -> raise "<script>xss-error</script>" end)
334334

335335
assert conn.resp_body =~ "x=&lt;script&gt;alert(document.domain)&lt;/script&gt;"
336336
assert conn.resp_body =~ "&lt;script&gt;xss-header&lt;/script&gt;"
337337
assert conn.resp_body =~ "&lt;script&gt;xss-val&lt;/script&gt;"
338-
assert conn.resp_body =~ "&lt;script&gt;oops&lt;/script&gt;"
338+
assert conn.resp_body =~ "&lt;script&gt;xss-error&lt;/script&gt;"
339+
340+
refute conn.resp_body =~ "<script>alert"
341+
refute conn.resp_body =~ "<script>xss"
339342
end
340343

341344
test "uses PLUG_EDITOR with __FILE__" do

0 commit comments

Comments
 (0)