From 4994d36b663951d93d90b865cb18876bb0f20e42 Mon Sep 17 00:00:00 2001 From: Vangelis Tsoumenis Date: Sun, 29 Jun 2014 20:30:11 +0200 Subject: [PATCH] templateform.RenderForm now renders textarea When RenderForm encounters a field with the structTag `form` value type `textarea` it renders an actual `) if output != result { t.Errorf("output should equal `%v` but got `%v`", result, output) } } +func TestRenderFormField(t *testing.T) { + html := renderFormField("Label: ", "Name", "text", "Value") + if html != `Label: ` { + t.Errorf("Wrong html output for input[type=text]: %v ", html) + } + + html = renderFormField("Label: ", "Name", "textarea", "Value") + if html != `Label: ` { + t.Errorf("Wrong html output for textarea: %v ", html) + } +} + func TestParseFormTag(t *testing.T) { // create struct to contain field with different types of struct-tag `form` type user struct {