aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-03-18 15:52:43 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-03-18 15:52:43 -0700
commit71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b (patch)
tree4e4a89ceca056d7ee4fcf329ecb56bbc0547d553 /actionpack/test/controller
parent523d0f3700f5bb68cdd3d549eaad63d8a88c2aef (diff)
downloadrails-71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b.tar.gz
rails-71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b.tar.bz2
rails-71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b.zip
All tests pass without memoizing view_context
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/caching_test.rb8
-rw-r--r--actionpack/test/controller/render_test.rb8
2 files changed, 13 insertions, 3 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index f6264c0954..5157454be0 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -616,8 +616,10 @@ class FragmentCachingTest < ActionController::TestCase
@store.write('views/expensive', 'fragment content')
fragment_computed = false
+ view_context = @controller.view_context
+
buffer = 'generated till now -> '.html_safe
- buffer << @controller.fragment_for('expensive') { fragment_computed = true }
+ buffer << view_context.send(:fragment_for, 'expensive') { fragment_computed = true }
assert fragment_computed
assert_equal 'generated till now -> ', buffer
@@ -627,8 +629,10 @@ class FragmentCachingTest < ActionController::TestCase
@store.write('views/expensive', 'fragment content')
fragment_computed = false
+ view_context = @controller.view_context
+
buffer = 'generated till now -> '.html_safe
- buffer << @controller.fragment_for('expensive') { fragment_computed = true }
+ buffer << view_context.send(:fragment_for, 'expensive') { fragment_computed = true }
assert !fragment_computed
assert_equal 'generated till now -> fragment content', buffer
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 1d7692f0a8..24817a93d2 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -18,6 +18,13 @@ class TestController < ActionController::Base
layout :determine_layout
+ def name
+ nil
+ end
+
+ private :name
+ helper_method :name
+
def hello_world
end
@@ -418,7 +425,6 @@ class TestController < ActionController::Base
def rendering_with_conflicting_local_vars
@name = "David"
- def view_context.name() nil end
render :action => "potential_conflicts"
end