argument error is done for us
This commit is contained in:
parent
1f6b0a554b
commit
38f6533792
@ -18,7 +18,8 @@ Rake::TestTask.new(:test_action_pack) do |t|
|
||||
# this will not happen automatically and the tests (as a whole) will error
|
||||
t.test_files = Dir.glob('test/{abstract,controller,dispatch,template}/**/*_test.rb').sort
|
||||
|
||||
# t.warning = true
|
||||
#t.warning = true
|
||||
t.verbose = true
|
||||
end
|
||||
|
||||
namespace :test do
|
||||
|
@ -840,8 +840,6 @@ def range_field(object_name, method, options = {})
|
||||
private
|
||||
|
||||
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 ||= {}
|
||||
|
||||
|
@ -640,6 +640,12 @@ def test_auto_index_with_nil_id
|
||||
)
|
||||
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
|
||||
assert_deprecated do
|
||||
form_for(:post, @post, :html => { :id => 'create-post' }) do |f|
|
||||
|
Loading…
Reference in New Issue
Block a user