aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-02-25 19:33:50 -0800
committerJohn Hawthorn <john@hawthorn.email>2019-02-26 16:59:04 -0800
commitc2145462178d2b28135fac38ebbceeaadfa151df (patch)
treeebad7770e18f73949b1a75e32fdbaa5892d9f908 /actionview/test/template
parentff4b2cf2410286e75b2ad41c9733ef41f65fba15 (diff)
downloadrails-c2145462178d2b28135fac38ebbceeaadfa151df.tar.gz
rails-c2145462178d2b28135fac38ebbceeaadfa151df.tar.bz2
rails-c2145462178d2b28135fac38ebbceeaadfa151df.zip
Create templates with format=nil
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/lookup_context_test.rb4
-rw-r--r--actionview/test/template/resolver_patterns_test.rb2
-rw-r--r--actionview/test/template/testing/fixture_resolver_test.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/actionview/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb
index a763e24226..62935620e9 100644
--- a/actionview/test/template/lookup_context_test.rb
+++ b/actionview/test/template/lookup_context_test.rb
@@ -121,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.format
+ assert_nil template.format
end
end
diff --git a/actionview/test/template/resolver_patterns_test.rb b/actionview/test/template/resolver_patterns_test.rb
index 38357aa10b..8122de779f 100644
--- a/actionview/test/template/resolver_patterns_test.rb
+++ b/actionview/test/template/resolver_patterns_test.rb
@@ -19,7 +19,7 @@ class ResolverPatternsTest < ActiveSupport::TestCase
assert_equal 1, templates.size, "expected one template"
assert_equal "Hello custom patterns!", templates.first.source
assert_equal "custom_pattern/path", templates.first.virtual_path
- assert_equal :html, templates.first.format
+ assert_nil templates.first.format
end
def test_should_return_all_templates_when_ambiguous_pattern
diff --git a/actionview/test/template/testing/fixture_resolver_test.rb b/actionview/test/template/testing/fixture_resolver_test.rb
index 4361824a71..afb6686dac 100644
--- a/actionview/test/template/testing/fixture_resolver_test.rb
+++ b/actionview/test/template/testing/fixture_resolver_test.rb
@@ -15,6 +15,6 @@ class FixtureResolverTest < ActiveSupport::TestCase
assert_equal 1, templates.size, "expected one template"
assert_equal "this text", templates.first.source
assert_equal "arbitrary/path", templates.first.virtual_path
- assert_equal :html, templates.first.format
+ assert_nil templates.first.format
end
end