From 156039c4cf7f0e0ad697443b121b46d3fe57d801 Mon Sep 17 00:00:00 2001 From: Burke Libbey Date: Fri, 6 May 2011 14:02:31 -0500 Subject: Added a test for MissingTemplate change, and changed to use Array.wrap() as requested by josevalim. --- actionpack/test/template/lookup_context_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb index 5fb1fdc044..94af97ee11 100644 --- a/actionpack/test/template/lookup_context_test.rb +++ b/actionpack/test/template/lookup_context_test.rb @@ -251,4 +251,13 @@ class TestMissingTemplate < ActiveSupport::TestCase end assert_match %r{Missing partial parent/foo, child/foo with .* Searched in:\n \* "/Path/to/views"\n}, e.message end + + test "if a single prefix is passed as a string and the lookup fails, MissingTemplate accepts it" do + e = assert_raise ActionView::MissingTemplate do + details = {:handlers=>[], :formats=>[], :locale=>[]} + @lookup_context.view_paths.find("foo", "parent", true, details) + end + assert_match %r{Missing partial parent/foo with .* Searched in:\n \* "/Path/to/views"\n}, e.message + end + end -- cgit v1.2.3