1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Add a test for the :views render option

This commit is contained in:
Simon Rozet 2009-05-23 16:15:19 +02:00
parent a9e0bfcdd9
commit 428a1ec51d
3 changed files with 8 additions and 0 deletions

View file

@ -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

View file

@ -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 {

View file

@ -0,0 +1 @@
from another views directory