From c769ad85336713b7e5bdadd57d92a007783f8208 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 12 May 2007 21:12:31 +0000 Subject: Removed deprecated parameters_for_method_reference concept (legacy from before named routes) [DHH] Added record identification with polymorphic routes for ActionController::Base#url_for and ActionView::Base#url_for [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6729 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/form_helper_test.rb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'actionpack/test/template/form_helper_test.rb') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index c5e7505a36..a7336c5b08 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -38,7 +38,7 @@ class FormHelperTest < Test::Unit::TestCase @controller = Class.new do attr_reader :url_for_options - def url_for(options, *parameters_for_method_reference) + def url_for(options) @url_for_options = options "http://www.example.com" end @@ -528,7 +528,7 @@ class FormHelperTest < Test::Unit::TestCase form_for(:post, @post, :url => 'http://www.otherdomain.com') do |f| end - assert_equal 'http://www.otherdomain.com', @controller.url_for_options + assert_equal '
', _erbout end def test_form_for_with_hash_url_option @@ -540,6 +540,14 @@ class FormHelperTest < Test::Unit::TestCase assert_equal 'action', @controller.url_for_options[:action] end + def test_form_for_with_record_url_option + _erbout = '' + + form_for(:post, @post, :url => @post) do |f| end + + expected = "
" + end + def test_remote_form_for_with_html_options_adds_options_to_form_tag self.extend ActionView::Helpers::PrototypeHelper _erbout = '' @@ -549,4 +557,10 @@ class FormHelperTest < Test::Unit::TestCase assert_dom_equal expected, _erbout end -end + + + protected + def polymorphic_path(record, url_writer) + "/posts/#{record.id}" + end +end \ No newline at end of file -- cgit v1.2.3