diff options
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/fallback_file_system_resolver_test.rb | 16 | ||||
-rw-r--r-- | actionview/test/template/html_test.rb | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/actionview/test/template/fallback_file_system_resolver_test.rb b/actionview/test/template/fallback_file_system_resolver_test.rb new file mode 100644 index 0000000000..304cdb8a03 --- /dev/null +++ b/actionview/test/template/fallback_file_system_resolver_test.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require "abstract_unit" + +class FallbackFileSystemResolverTest < ActiveSupport::TestCase + def setup + @root_resolver = ActionView::FallbackFileSystemResolver.new("/") + end + + def test_should_have_no_virtual_path + templates = @root_resolver.find_all("hello_world.erb", "#{FIXTURE_LOAD_PATH}/test", false, locale: [], formats: [:html], variants: [], handlers: [:erb]) + assert_equal 1, templates.size + assert_equal "Hello world!", templates[0].source + assert_nil templates[0].virtual_path + end +end diff --git a/actionview/test/template/html_test.rb b/actionview/test/template/html_test.rb index c5fc8f906c..17f21cbbc5 100644 --- a/actionview/test/template/html_test.rb +++ b/actionview/test/template/html_test.rb @@ -8,9 +8,9 @@ class HTMLTest < ActiveSupport::TestCase end test "formats returns string for recognized MIME type when MIME does not have symbol" do - foo = Mime::Type.lookup("foo") + foo = Mime::Type.lookup("text/foo") assert_nil foo.to_sym - assert_equal "foo", ActionView::Template::HTML.new("", foo).format + assert_equal "text/foo", ActionView::Template::HTML.new("", foo).format end test "formats returns string for unknown MIME type" do |