Skip to content

Commit

Permalink
Add a test for the :views render option
Browse files Browse the repository at this point in the history
  • Loading branch information
sr committed May 23, 2009
1 parent a9e0bfc commit 428a1ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions sinatra.gemspec
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/templates_test.rb
Expand Up @@ -76,6 +76,12 @@ def with_default_layout
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 {
Expand Down
1 change: 1 addition & 0 deletions test/views/foo/hello.test
@@ -0,0 +1 @@
from another views directory

0 comments on commit 428a1ec

Please sign in to comment.