aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-03-24 21:24:40 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-03-24 21:24:40 +0000
commit123f5a357dc176225d57dc78e773338642048120 (patch)
tree9981644698a0d3bc8982b30984b7b00adf1b5364 /actionpack/test/template
parent0e62c773f603f885743d52f44fb032290f809cae (diff)
downloadrails-123f5a357dc176225d57dc78e773338642048120.tar.gz
rails-123f5a357dc176225d57dc78e773338642048120.tar.bz2
rails-123f5a357dc176225d57dc78e773338642048120.zip
Added :confirm option to submit_tag (closes #11415) [miloops]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9087 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 4160c838cc..7caa85802a 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -221,11 +221,18 @@ 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!');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" />),
+ %(<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
+ def test_submit_tag_with_confirmation
+ assert_dom_equal(
+ %(<input name='commit' type='submit' value='Save' onclick="return confirm('Are you sure?');"/>),
+ submit_tag("Save", :confirm => "Are you sure?")
+ )
+ end
+
def test_pass
assert_equal 1, 1
end