@@ -46,11 +46,35 @@ public class FormTagLibTests extends AbstractGrailsTagTests {
4646 // use sorted map to be able to predict the order in which tag attributes are generated
4747 def attributes = new TreeMap ([url :[controller :' con' , action :' action' ], id :' formElementId' ])
4848 tag. call(attributes, { })
49- println sw. toString()
5049 assertEquals ' <form action="/con/action" method="post" id="formElementId" ></form>' , sw. toString(). trim()
5150 }
5251 }
5352
53+ void testActionSubmitWhitespace () {
54+ final StringWriter sw = new StringWriter ();
55+ final PrintWriter pw = new PrintWriter (sw);
56+
57+ withTag(" actionSubmit" , pw) { tag ->
58+ // use sorted map to be able to predict the order in which tag attributes are generated
59+ def attributes = new TreeMap ([value :' Go' ])
60+ tag. call(attributes)
61+ println sw. toString()
62+ assertEquals ' <input type="submit" name="_action" value="Go" />' , sw. toString() // NO TRIM, TEST WS!
63+ }
64+ }
65+
66+ void testActionSubmitImageWhitespace () {
67+ final StringWriter sw = new StringWriter ();
68+ final PrintWriter pw = new PrintWriter (sw);
69+
70+ withTag(" actionSubmitImage" , pw) { tag ->
71+ // use sorted map to be able to predict the order in which tag attributes are generated
72+ def attributes = new TreeMap ([src :' button.gif' , value :' Go' ])
73+ tag. call(attributes)
74+ assertEquals ' <input type="image" name="_action" value="Go" src="button.gif" />' , sw. toString() // NO TRIM, TEST WS!
75+ }
76+ }
77+
5478 public void testHtmlEscapingTextAreaTag () {
5579 final StringWriter sw = new StringWriter ();
5680 final PrintWriter pw = new PrintWriter (sw);
0 commit comments