1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/template/erb/form_for_test.rb
José Valim e3d8331c5b Revert "Remove deprecated form_for with strings or symbols"
This code was not deprecated. What was deprecated is the following:

  form_for(:foo, @foo)

Which now should be rewritten as:

  form_for(@foo, :as => :foo)

The following format is valid:

  form_for(:foo)

This reverts commit be797750e6.
2010-11-18 20:22:14 +01:00

11 lines
352 B
Ruby

require "abstract_unit"
require "template/erb/helper"
module ERBTest
class TagHelperTest < BlockTestCase
test "form_for works" do
output = render_content "form_for(:staticpage, :url => {:controller => 'blah', :action => 'update'})", ""
assert_match %r{<form.*action="/blah/update".*method="post">.*</form>}, output
end
end
end