Open ndrean opened 1 year ago
Hi there!
I have a basic controller "welcome" that does: render(conn, "index.html", profile: profile) There are some assigns to render
render(conn, "index.html", profile: profile)
I want to write a test that demonstrates that the rendering is correct
if I do:
conn = get(conn, "/welcome") assert html_response(conn, 200) =~"hi"
Since some template assigns are present in the template, my test says that a key is not present.
Using Plug.Conn.assign(conn, :profile, %{k: v}) is ineffective.
Plug.Conn.assign(conn, :profile, %{k: v})
Does anyone know how to do this? The doc is void on this or didn't find where.
Hi there!
I have a basic controller "welcome" that does:
render(conn, "index.html", profile: profile)
There are some assigns to renderI want to write a test that demonstrates that the rendering is correct
if I do:
Since some template assigns are present in the template, my test says that a key is not present.
Using
Plug.Conn.assign(conn, :profile, %{k: v})
is ineffective.Does anyone know how to do this? The doc is void on this or didn't find where.