aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorScott Stewart <scott@izoca.com>2008-07-02 01:36:58 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-07-02 01:39:30 +0100
commit7378e237342443addb1691795ac9457250b6db1e (patch)
tree5047524787fb95121fccae812f66c9d4d302b659 /actionpack/test
parent6f1d827096ad9f1044a6da7141e7ae720a64ec6b (diff)
downloadrails-7378e237342443addb1691795ac9457250b6db1e.tar.gz
rails-7378e237342443addb1691795ac9457250b6db1e.tar.bz2
rails-7378e237342443addb1691795ac9457250b6db1e.zip
Ensure proper output when submit_tag is used with :disabled_with. [#388 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index eabbe9c8a0..4e4102aec7 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -222,6 +222,13 @@ class FormTagHelperTest < ActionView::TestCase
)
end
+ def test_submit_tag_with_no_onclick_options
+ assert_dom_equal(
+ %(<input name='commit' type='submit' value='Save' onclick="this.setAttribute('originalValue', this.value);this.disabled=true;this.value='Saving...';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...")
+ )
+ end
+
def test_submit_tag_with_confirmation
assert_dom_equal(
%(<input name='commit' type='submit' value='Save' onclick="return confirm('Are you sure?');"/>),