aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/lookup_context_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template/lookup_context_test.rb')
-rw-r--r--actionview/test/template/lookup_context_test.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/actionview/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb
index 290f832794..62935620e9 100644
--- a/actionview/test/template/lookup_context_test.rb
+++ b/actionview/test/template/lookup_context_test.rb
@@ -17,6 +17,16 @@ class LookupContextTest < ActiveSupport::TestCase
I18n.locale = :en
end
+ test "rendered_format is deprecated" do
+ assert_deprecated do
+ @lookup_context.rendered_format = "foo"
+ end
+
+ assert_deprecated do
+ assert_equal "foo", @lookup_context.rendered_format
+ end
+ end
+
test "allows to override default_formats with ActionView::Base.default_formats" do
formats = ActionView::Base.default_formats
ActionView::Base.default_formats = [:foo, :bar]
@@ -111,11 +121,11 @@ class LookupContextTest < ActiveSupport::TestCase
assert_equal "Hello texty phone!", template.source
end
- test "found templates respects given formats if one cannot be found from template or handler" do
+ test "found templates have nil format if one cannot be found from template or handler" do
assert_called(ActionView::Template::Handlers::Builder, :default_format, returns: nil) do
@lookup_context.formats = [:text]
template = @lookup_context.find("hello", %w(test))
- assert_equal [:text], template.formats
+ assert_nil template.format
end
end