aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-10 23:14:47 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-10 23:14:47 +0000
commit9aca06fbee44479eb8cccc5c19ecd8a85f0e0060 (patch)
tree69a80ec50820bd4e40a1573cb50e9577f8d8dffb /actionpack/test
parent18344e9b0e667b592c2990c25628738b2b161538 (diff)
downloadrails-9aca06fbee44479eb8cccc5c19ecd8a85f0e0060.tar.gz
rails-9aca06fbee44479eb8cccc5c19ecd8a85f0e0060.tar.bz2
rails-9aca06fbee44479eb8cccc5c19ecd8a85f0e0060.zip
More Action View refactoring. Knock :erb default down a notch. Closes #10455.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8374 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/compiled_templates_test.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionpack/test/template/compiled_templates_test.rb
index 1f52f40777..d7ef75eb8c 100644
--- a/actionpack/test/template/compiled_templates_test.rb
+++ b/actionpack/test/template/compiled_templates_test.rb
@@ -95,11 +95,13 @@ class CompiledTemplateTests < Test::Unit::TestCase
assert v.send(:compile_template?, nil, @b, {})
assert v.send(:compile_template?, nil, @s, {}) unless windows
+ @handler = ActionView::Base.handler_for_extension(:rhtml)
+
# All templates are rendered at t+2
Time.expects(:now).times(windows ? 2 : 3).returns(t + 2.seconds)
- v.compile_and_render_template(:rhtml, '', @a)
- v.compile_and_render_template(:rhtml, '', @b)
- v.compile_and_render_template(:rhtml, '', @s) unless windows
+ v.send(:compile_and_render_template, @handler, '', @a)
+ v.send(:compile_and_render_template, @handler, '', @b)
+ v.send(:compile_and_render_template, @handler, '', @s) unless windows
a_n = v.method_names[@a]
b_n = v.method_names[@b]
s_n = v.method_names[@s] unless windows
@@ -117,9 +119,9 @@ class CompiledTemplateTests < Test::Unit::TestCase
assert !v.send(:compile_template?, nil, @a, {})
assert !v.send(:compile_template?, nil, @b, {})
assert !v.send(:compile_template?, nil, @s, {}) unless windows
- v.compile_and_render_template(:rhtml, '', @a)
- v.compile_and_render_template(:rhtml, '', @b)
- v.compile_and_render_template(:rhtml, '', @s) unless windows
+ v.send(:compile_and_render_template, @handler, '', @a)
+ v.send(:compile_and_render_template, @handler, '', @b)
+ v.send(:compile_and_render_template, @handler, '', @s) unless windows
# none of the files have changed since last compile
assert v.compile_time[a_n] < t + 3.seconds
assert v.compile_time[b_n] < t + 3.seconds
@@ -142,9 +144,9 @@ class CompiledTemplateTests < Test::Unit::TestCase
# Only the symlink template gets rendered at t+3
Time.stubs(:now).returns(t + 3.seconds) unless windows
- v.compile_and_render_template(:rhtml, '', @a)
- v.compile_and_render_template(:rhtml, '', @b)
- v.compile_and_render_template(:rhtml, '', @s) unless windows
+ v.send(:compile_and_render_template, @handler, '', @a)
+ v.send(:compile_and_render_template, @handler, '', @b)
+ v.send(:compile_and_render_template, @handler, '', @s) unless windows
# the symlink has changed since last compile
assert v.compile_time[a_n] < t + 3.seconds
assert v.compile_time[b_n] < t + 3.seconds
@@ -167,9 +169,9 @@ class CompiledTemplateTests < Test::Unit::TestCase
assert v.send(:compile_template?, nil, @s, {}) unless windows
Time.expects(:now).times(windows ? 1 : 2).returns(t + 5.seconds)
- v.compile_and_render_template(:rhtml, '', @a)
- v.compile_and_render_template(:rhtml, '', @b)
- v.compile_and_render_template(:rhtml, '', @s) unless windows
+ v.send(:compile_and_render_template, @handler, '', @a)
+ v.send(:compile_and_render_template, @handler, '', @b)
+ v.send(:compile_and_render_template, @handler, '', @s) unless windows
# the file at the end of the symlink has changed since last compile
# both the symlink and the file at the end of it should be recompiled
assert v.compile_time[a_n] < t + 5.seconds