aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-18 16:25:11 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-18 16:25:11 +0000
commit129a159d1247b2bc9cc791a81ef3485e5b061648 (patch)
tree1a9f6bffb9336fa5812d7afd18b3b7a5df2f576a /actionpack/test
parentc2fb8ca393569105cb25bd79d1bf018c20cce51a (diff)
downloadrails-129a159d1247b2bc9cc791a81ef3485e5b061648.tar.gz
rails-129a159d1247b2bc9cc791a81ef3485e5b061648.tar.bz2
rails-129a159d1247b2bc9cc791a81ef3485e5b061648.zip
Fixed link_to "somewhere", :post => true to produce valid XHTML by using the parentnode instead of document.body for the instant form (closes #3007) [Bob Silva]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3928 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/url_helper_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 25ab89a584..85ce24b1c2 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -110,14 +110,14 @@ class UrlHelperTest < Test::Unit::TestCase
def test_link_tag_using_post_javascript
assert_dom_equal(
- "<a href=\"http://www.example.com\" onclick=\"var f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();return false;\">Hello</a>",
+ "<a href=\"http://www.example.com\" onclick=\"var f = document.createElement('form'); this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();return false;\">Hello</a>",
link_to("Hello", "http://www.example.com", :post => true)
)
end
def test_link_tag_using_post_javascript_and_confirm
assert_dom_equal(
- "<a href=\"http://www.example.com\" onclick=\"if (confirm('Are you serious?')) { var f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit(); };return false;\">Hello</a>",
+ "<a href=\"http://www.example.com\" onclick=\"if (confirm('Are you serious?')) { var f = document.createElement('form'); this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit(); };return false;\">Hello</a>",
link_to("Hello", "http://www.example.com", :post => true, :confirm => "Are you serious?")
)
end