aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/text_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template/text_test.rb')
-rw-r--r--actionview/test/template/text_test.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/actionview/test/template/text_test.rb b/actionview/test/template/text_test.rb
index 6510688f97..0c6470df21 100644
--- a/actionview/test/template/text_test.rb
+++ b/actionview/test/template/text_test.rb
@@ -1,17 +1,25 @@
+# frozen_string_literal: true
+
require "abstract_unit"
class TextTest < ActiveSupport::TestCase
- test "formats returns symbol for recognized MIME type" do
- assert_equal [:text], ActionView::Template::Text.new("", :text).formats
+ test "formats always return :text" do
+ assert_equal [:text], ActionView::Template::Text.new("").formats
+ end
+
+ test "identifier should return 'text template'" do
+ assert_equal "text template", ActionView::Template::Text.new("").identifier
+ end
+
+ test "inspect should return 'text template'" do
+ assert_equal "text template", ActionView::Template::Text.new("").inspect
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::Text.new("", foo).formats
+ test "to_str should return a given string" do
+ assert_equal "a cat", ActionView::Template::Text.new("a cat").to_str
end
- test "formats returns string for unknown MIME type" do
- assert_equal ["foo"], ActionView::Template::Text.new("", "foo").formats
+ test "render should return a given string" do
+ assert_equal "a dog", ActionView::Template::Text.new("a dog").render
end
end