aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2019-02-25 14:04:10 -0800
committerGitHub <noreply@github.com>2019-02-25 14:04:10 -0800
commit56b030605b4d968077a4ddb96b4ab619e75fb999 (patch)
tree7658993bdbb1a78094d2cbe3d88691983aa88277 /actionview/test
parent790a3e69acb2fa172c6bce45e040e9f15d9bef3d (diff)
parentca5e23ed4d8818d81314953aadd422b2cbde63b0 (diff)
downloadrails-56b030605b4d968077a4ddb96b4ab619e75fb999.tar.gz
rails-56b030605b4d968077a4ddb96b4ab619e75fb999.tar.bz2
rails-56b030605b4d968077a4ddb96b4ab619e75fb999.zip
Merge pull request #35406 from rails/template-has-one-format
Templates have one format
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/actionpack/controller/view_paths_test.rb2
-rw-r--r--actionview/test/template/digestor_test.rb2
-rw-r--r--actionview/test/template/html_test.rb6
-rw-r--r--actionview/test/template/lookup_context_test.rb2
-rw-r--r--actionview/test/template/resolver_patterns_test.rb2
-rw-r--r--actionview/test/template/testing/fixture_resolver_test.rb2
-rw-r--r--actionview/test/template/testing/null_resolver_test.rb2
-rw-r--r--actionview/test/template/text_test.rb2
8 files changed, 10 insertions, 10 deletions
diff --git a/actionview/test/actionpack/controller/view_paths_test.rb b/actionview/test/actionpack/controller/view_paths_test.rb
index c5238dd746..a7a58a78cc 100644
--- a/actionview/test/actionpack/controller/view_paths_test.rb
+++ b/actionview/test/actionpack/controller/view_paths_test.rb
@@ -144,7 +144,7 @@ class ViewLoadPathsTest < ActionController::TestCase
template.identifier,
template.handler,
virtual_path: template.virtual_path,
- format: template.formats
+ format: template.format
)
end
end
diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb
index 91861edf11..7affd3c005 100644
--- a/actionview/test/template/digestor_test.rb
+++ b/actionview/test/template/digestor_test.rb
@@ -361,7 +361,7 @@ class TemplateDigestorTest < ActionView::TestCase
def tree_template_formats(template_name)
tree = ActionView::Digestor.tree(template_name, finder)
- tree.flatten.map(&:template).compact.flat_map(&:formats)
+ tree.flatten.map(&:template).compact.map(&:format)
end
def disable_resolver_caching
diff --git a/actionview/test/template/html_test.rb b/actionview/test/template/html_test.rb
index 5cdff74d60..c5fc8f906c 100644
--- a/actionview/test/template/html_test.rb
+++ b/actionview/test/template/html_test.rb
@@ -4,16 +4,16 @@ require "abstract_unit"
class HTMLTest < ActiveSupport::TestCase
test "formats returns symbol for recognized MIME type" do
- assert_equal [:html], ActionView::Template::HTML.new("", :html).formats
+ assert_equal :html, ActionView::Template::HTML.new("", :html).format
end
test "formats returns string for recognized MIME type when MIME does not have symbol" do
foo = Mime::Type.lookup("foo")
assert_nil foo.to_sym
- assert_equal ["foo"], ActionView::Template::HTML.new("", foo).formats
+ assert_equal "foo", ActionView::Template::HTML.new("", foo).format
end
test "formats returns string for unknown MIME type" do
- assert_equal ["foo"], ActionView::Template::HTML.new("", "foo").formats
+ assert_equal "foo", ActionView::Template::HTML.new("", "foo").format
end
end
diff --git a/actionview/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb
index 5298afb694..a763e24226 100644
--- a/actionview/test/template/lookup_context_test.rb
+++ b/actionview/test/template/lookup_context_test.rb
@@ -125,7 +125,7 @@ class LookupContextTest < ActiveSupport::TestCase
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_equal :text, template.format
end
end
diff --git a/actionview/test/template/resolver_patterns_test.rb b/actionview/test/template/resolver_patterns_test.rb
index 1e1a4c5063..38357aa10b 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.formats
+ assert_equal :html, 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 9954e3500d..4361824a71 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.formats
+ assert_equal :html, templates.first.format
end
end
diff --git a/actionview/test/template/testing/null_resolver_test.rb b/actionview/test/template/testing/null_resolver_test.rb
index 53364c1d90..dad8d0966d 100644
--- a/actionview/test/template/testing/null_resolver_test.rb
+++ b/actionview/test/template/testing/null_resolver_test.rb
@@ -9,6 +9,6 @@ class NullResolverTest < ActiveSupport::TestCase
assert_equal 1, templates.size, "expected one template"
assert_equal "Template generated by Null Resolver", templates.first.source
assert_equal "arbitrary/path.erb", templates.first.virtual_path.to_s
- assert_equal [:html], templates.first.formats
+ assert_equal :html, templates.first.format
end
end
diff --git a/actionview/test/template/text_test.rb b/actionview/test/template/text_test.rb
index 0c6470df21..e7e3b6aae8 100644
--- a/actionview/test/template/text_test.rb
+++ b/actionview/test/template/text_test.rb
@@ -4,7 +4,7 @@ require "abstract_unit"
class TextTest < ActiveSupport::TestCase
test "formats always return :text" do
- assert_equal [:text], ActionView::Template::Text.new("").formats
+ assert_equal :text, ActionView::Template::Text.new("").format
end
test "identifier should return 'text template'" do