mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
add tests to make sure deprecated API is still supported
This commit is contained in:
parent
315b9def91
commit
eda0f574f1
2 changed files with 14 additions and 2 deletions
|
@ -224,10 +224,12 @@ module ActionView #:nodoc:
|
|||
|
||||
# :startdoc:
|
||||
|
||||
def initialize(renderer, assigns = {}, controller = nil, formats = NULL) #:nodoc:
|
||||
def initialize(renderer = nil, assigns = {}, controller = nil, formats = NULL) #:nodoc:
|
||||
@_config = ActiveSupport::InheritableOptions.new
|
||||
|
||||
unless formats == NULL
|
||||
if formats == NULL
|
||||
formats = nil
|
||||
else
|
||||
ActiveSupport::Deprecation.warn <<~eowarn
|
||||
Passing formats to ActionView::Base.new is deprecated
|
||||
eowarn
|
||||
|
|
|
@ -336,6 +336,16 @@ module RenderTestCases
|
|||
assert_equal "Hello: davidHello: mary", @view.render(partial: "test/customer", collection: customers)
|
||||
end
|
||||
|
||||
def test_deprecated_constructor
|
||||
assert_deprecated do
|
||||
ActionView::Base.new
|
||||
end
|
||||
|
||||
assert_deprecated do
|
||||
ActionView::Base.new ["/a"]
|
||||
end
|
||||
end
|
||||
|
||||
def test_render_partial_without_object_does_not_put_partial_name_to_local_assigns
|
||||
assert_equal "false", @view.render(partial: "test/partial_name_in_local_assigns")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue