aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorTom Stuart <tom@experthuman.com>2011-02-12 11:34:49 +0000
committerSantiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>2011-02-12 13:51:02 -0200
commit03749d6c88ae8312dc959b7683851dbf8c969326 (patch)
treede0ad9e7a607bc55b7681c7970d751d084a44be4 /actionpack/test/template
parente8c870726a67a27965b2a5333a5ecf450d4f458f (diff)
downloadrails-03749d6c88ae8312dc959b7683851dbf8c969326.tar.gz
rails-03749d6c88ae8312dc959b7683851dbf8c969326.tar.bz2
rails-03749d6c88ae8312dc959b7683851dbf8c969326.zip
Make type="submit" the default for button_tag helper
"submit" is the default value of the <button> element's type attribute according to the HTML 4.01 and the HTML5 draft specs, so if button_tag is going to have a default, type="submit" is a more sensible choice than type="button". http://www.w3.org/TR/html401/interact/forms.html#adef-type-BUTTON http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type Signed-off-by: Santiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 4a584b8db8..c22af258c3 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -387,7 +387,7 @@ class FormTagHelperTest < ActionView::TestCase
def test_button_tag
assert_dom_equal(
- %(<button name="button" type="button">Button</button>),
+ %(<button name="button" type="submit">Button</button>),
button_tag
)
end
@@ -399,6 +399,13 @@ class FormTagHelperTest < ActionView::TestCase
)
end
+ def test_button_tag_with_button_type
+ assert_dom_equal(
+ %(<button name="button" type="button">Button</button>),
+ button_tag("Button", :type => "button")
+ )
+ end
+
def test_button_tag_with_reset_type
assert_dom_equal(
%(<button name="button" type="reset">Reset</button>),