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:
parent
a9e0bfcdd9
commit
428a1ec51d
3 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
1
test/views/foo/hello.test
Normal file
1
test/views/foo/hello.test
Normal file
|
@ -0,0 +1 @@
|
|||
from another views directory
|
Loading…
Reference in a new issue