Write _inject_html and _render_form middleware methods and their corresponding unit tests.