diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-10 18:07:33 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-10 18:07:33 -0300 |
commit | 0e2fbd80e2420329738b891240d44a056cea1de4 (patch) | |
tree | 5b16755670be58e168b5e86e2cdcb43ee5aa3918 /actionpack/test/template/url_helper_test.rb | |
parent | eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413 (diff) | |
parent | 600a89f2082beadf4af9fe140a1a2ae56386cd49 (diff) | |
download | rails-0e2fbd80e2420329738b891240d44a056cea1de4.tar.gz rails-0e2fbd80e2420329738b891240d44a056cea1de4.tar.bz2 rails-0e2fbd80e2420329738b891240d44a056cea1de4.zip |
Merge commit 'rails/master'
Conflicts:
activerecord/lib/active_record/calculations.rb
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 9eeb26831c..0e24fbd24d 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -220,6 +220,14 @@ class UrlHelperTest < ActionView::TestCase ) end + def test_link_tag_using_delete_javascript_and_href_and_confirm + assert_dom_equal( + "<a href='\#' onclick=\"if (confirm('Are you serious?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = 'http://www.example.com';var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);f.submit(); };return false;\">Destroy</a>", + link_to("Destroy", "http://www.example.com", :method => :delete, :href => '#', :confirm => "Are you serious?"), + "When specifying url, form should be generated with it, but not this.href" + ) + end + def test_link_tag_using_post_javascript_and_popup assert_raise(ActionView::ActionViewError) { link_to("Hello", "http://www.example.com", :popup => true, :method => :post, :confirm => "Are you serious?") } end |