1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

argument error is done for us

This commit is contained in:
Aaron Patterson 2010-09-18 14:00:00 -07:00
parent 1f6b0a554b
commit 38f6533792
3 changed files with 8 additions and 3 deletions

View file

@ -19,6 +19,7 @@ Rake::TestTask.new(:test_action_pack) do |t|
t.test_files = Dir.glob('test/{abstract,controller,dispatch,template}/**/*_test.rb').sort t.test_files = Dir.glob('test/{abstract,controller,dispatch,template}/**/*_test.rb').sort
#t.warning = true #t.warning = true
t.verbose = true
end end
namespace :test do namespace :test do

View file

@ -840,8 +840,6 @@ module ActionView
private private
def instantiate_builder(record, record_object = nil, options = nil, &block) def instantiate_builder(record, record_object = nil, options = nil, &block)
raise ArgumentError, "Missing block" unless block_given?
options, record_object = record_object, nil if record_object.is_a?(Hash) options, record_object = record_object, nil if record_object.is_a?(Hash)
options ||= {} options ||= {}

View file

@ -640,6 +640,12 @@ class FormHelperTest < ActionView::TestCase
) )
end end
def test_form_for_requires_block
assert_raises(ArgumentError) do
form_for(:post, @post, :html => { :id => 'create-post' })
end
end
def test_form_for def test_form_for
assert_deprecated do assert_deprecated do
form_for(:post, @post, :html => { :id => 'create-post' }) do |f| form_for(:post, @post, :html => { :id => 'create-post' }) do |f|