diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-03-27 19:42:54 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-03-27 19:42:54 +0000 |
commit | 0228975a4ecfaf81e8d8b8662abdc91ff67dbf42 (patch) | |
tree | f7b80faf06ce15c1589bcdbd223cdadbf03a95db /actionpack/test | |
parent | 2a305949d756c054cee349c1ef3b39c6cf1496f8 (diff) | |
download | rails-0228975a4ecfaf81e8d8b8662abdc91ff67dbf42.tar.gz rails-0228975a4ecfaf81e8d8b8662abdc91ff67dbf42.tar.bz2 rails-0228975a4ecfaf81e8d8b8662abdc91ff67dbf42.zip |
Added that FormTagHelper#submit_tag will return to its original state if the submit fails and you're using :disable_with [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_tag_helper_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 7750f41bd1..8b5d09d2a6 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -138,7 +138,7 @@ class FormTagHelperTest < Test::Unit::TestCase def test_submit_tag assert_dom_equal( - %(<input name='commit' type='submit' value='Save' onclick="this.setAttribute('originalValue', this.value);this.disabled=true;this.value='Saving...';alert('hello!');return (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit())" />), + %(<input name='commit' type='submit' value='Save' onclick="this.setAttribute('originalValue', this.value);this.disabled=true;this.value='Saving...';alert('hello!');result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue'); this.disabled = false };return result" />), submit_tag("Save", :disable_with => "Saving...", :onclick => "alert('hello!')") ) end |