Permalink
Browse files

Add a test for the :views render option

  • Loading branch information...
1 parent cb40723 commit 365c9e197c6da3cab0fc33b22174f2ddcc3de7e2 @sr sr committed with rtomayko May 23, 2009
Showing with 8 additions and 0 deletions.
  1. +1 −0 sinatra.gemspec
  2. +6 −0 test/templates_test.rb
  3. +1 −0 test/views/foo/hello.test
View
@@ -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
@@ -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 {
@@ -0,0 +1 @@
+from another views directory

0 comments on commit 365c9e1

Please sign in to comment.