aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/render_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-11-28 11:18:28 -0600
committerJoshua Peek <josh@joshpeek.com>2008-11-28 11:18:28 -0600
commit9fc23745f1511d8d97433828d9ca87970994d138 (patch)
tree83b606852608845853fc5a005949812dfa5160d6 /actionpack/test/template/render_test.rb
parent5fa0457542b0ff541d0a80ff8c3561eec8e35959 (diff)
downloadrails-9fc23745f1511d8d97433828d9ca87970994d138.tar.gz
rails-9fc23745f1511d8d97433828d9ca87970994d138.tar.bz2
rails-9fc23745f1511d8d97433828d9ca87970994d138.zip
Reinstate "Super lazy load view paths in development mode (no indexing or caching at all). Switch layout finders to use view path api to take advantage of cache." as it killed dev mode reloading."
Diffstat (limited to 'actionpack/test/template/render_test.rb')
-rw-r--r--actionpack/test/template/render_test.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index b316d5c23e..28d38b0c76 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -4,7 +4,9 @@ require 'controller/fake_models'
class ViewRenderTest < Test::Unit::TestCase
def setup
@assigns = { :secret => 'in the sauce' }
- @view = ActionView::Base.new(ActionController::Base.view_paths, @assigns)
+ view_paths = ActionController::Base.view_paths
+ @view = ActionView::Base.new(view_paths, @assigns)
+ assert view_paths.first.loaded?
end
def test_render_file
@@ -157,7 +159,7 @@ class ViewRenderTest < Test::Unit::TestCase
end
def test_render_fallbacks_to_erb_for_unknown_types
- assert_equal "Hello, World!", @view.render(:inline => "Hello, World!", :type => :foo)
+ assert_equal "Hello, World!", @view.render(:inline => "Hello, World!", :type => :bar)
end
CustomHandler = lambda do |template|
@@ -196,3 +198,14 @@ class ViewRenderTest < Test::Unit::TestCase
@view.render(:file => "test/nested_layout.erb", :layout => "layouts/yield")
end
end
+
+class LazyViewRenderTest < ViewRenderTest
+ # Test the same thing as above, but make sure the view path
+ # is not eager loaded
+ def setup
+ @assigns = { :secret => 'in the sauce' }
+ view_paths = ActionView::Base.process_view_paths(FIXTURE_LOAD_PATH)
+ @view = ActionView::Base.new(view_paths, @assigns)
+ assert !view_paths.first.loaded?
+ end
+end