diff --git a/sinatra.gemspec b/sinatra.gemspec index c169c99f..ae50f1f7 100644 --- a/sinatra.gemspec +++ b/sinatra.gemspec @@ -96,6 +96,7 @@ Gem::Specification.new do |s| test/views/error.erb test/views/error.haml test/views/error.sass + test/views/foo/hello.test test/views/hello.builder test/views/hello.erb test/views/hello.haml diff --git a/test/templates_test.rb b/test/templates_test.rb index 9cc663e1..d2febc91 100644 --- a/test/templates_test.rb +++ b/test/templates_test.rb @@ -76,6 +76,12 @@ class TemplatesTest < Test::Unit::TestCase assert_equal "X\n= yield\nX\n", @app.templates[:layout][:template] end + it 'loads templates from specified views directory' do + render_app { render :test, :hello, :views => options.views + '/foo' } + + assert_equal "from another views directory\n", body + end + test 'use_in_file_templates simply ignores IO errors' do assert_nothing_raised { mock_app { diff --git a/test/views/foo/hello.test b/test/views/foo/hello.test new file mode 100644 index 00000000..2aba6341 --- /dev/null +++ b/test/views/foo/hello.test @@ -0,0 +1 @@ +from another views directory