Render app.html.eex to string

Is there a way I can directly render the standard app.html.eex template in LayoutView to a string? I want to test the contents of the layout preferably without having to load a child template inside of it.

Thanks!

Maybe you can pass an empty child template to it?

I was getting the ** (KeyError) key :phoenix_endpoint not found in: %{phoenix_recycled: true, plug_skip_csrf_protection: true} error, so I piped the conn through bypass_through/3 before trying to render the template with it. Then I tried this:

content = render_to_string(FooWeb.LayoutView, "app.html", conn: conn, view_module: FooWeb.BarView, view_template: "index.html")

Even doing this using a valid view module and template from my app, the test just hangs until the database connection times out.

I tried that but it didn’t work either :confused: