aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/compiled_templates_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-11-19 14:00:16 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-19 14:00:16 +0100
commit130fe74d17404e5c06353526c7b20beb4019cb69 (patch)
treead15653d1f1ab20151d4bdc934106e8f857d08f7 /actionpack/test/template/compiled_templates_test.rb
parent0c9f677e7861ef2aae36d91811d72794e4709f58 (diff)
downloadrails-130fe74d17404e5c06353526c7b20beb4019cb69.tar.gz
rails-130fe74d17404e5c06353526c7b20beb4019cb69.tar.bz2
rails-130fe74d17404e5c06353526c7b20beb4019cb69.zip
Changed the default of ActionView#render to assume partials instead of files when not given an options hash [DHH]
Diffstat (limited to 'actionpack/test/template/compiled_templates_test.rb')
-rw-r--r--actionpack/test/template/compiled_templates_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionpack/test/template/compiled_templates_test.rb
index e005aa0f03..f7688b2072 100644
--- a/actionpack/test/template/compiled_templates_test.rb
+++ b/actionpack/test/template/compiled_templates_test.rb
@@ -12,30 +12,30 @@ uses_mocha 'TestTemplateRecompilation' do
def test_template_gets_compiled
assert_equal 0, @compiled_templates.instance_methods.size
- assert_equal "Hello world!", render("test/hello_world.erb")
+ assert_equal "Hello world!", render(:file => "test/hello_world.erb")
assert_equal 1, @compiled_templates.instance_methods.size
end
def test_template_gets_recompiled_when_using_different_keys_in_local_assigns
assert_equal 0, @compiled_templates.instance_methods.size
- assert_equal "Hello world!", render("test/hello_world.erb")
- assert_equal "Hello world!", render("test/hello_world.erb", {:foo => "bar"})
+ assert_equal "Hello world!", render(:file => "test/hello_world.erb")
+ assert_equal "Hello world!", render(:file => "test/hello_world.erb", :locals => {:foo => "bar"})
assert_equal 2, @compiled_templates.instance_methods.size
end
def test_compiled_template_will_not_be_recompiled_when_rendered_with_identical_local_assigns
assert_equal 0, @compiled_templates.instance_methods.size
- assert_equal "Hello world!", render("test/hello_world.erb")
+ assert_equal "Hello world!", render(:file => "test/hello_world.erb")
ActionView::Template.any_instance.expects(:compile!).never
- assert_equal "Hello world!", render("test/hello_world.erb")
+ assert_equal "Hello world!", render(:file => "test/hello_world.erb")
end
def test_compiled_template_will_always_be_recompiled_when_eager_loaded_templates_is_off
ActionView::PathSet::Path.expects(:eager_load_templates?).times(4).returns(false)
assert_equal 0, @compiled_templates.instance_methods.size
- assert_equal "Hello world!", render("#{FIXTURE_LOAD_PATH}/test/hello_world.erb")
+ assert_equal "Hello world!", render(:file => "#{FIXTURE_LOAD_PATH}/test/hello_world.erb")
ActionView::Template.any_instance.expects(:compile!).times(3)
- 3.times { assert_equal "Hello world!", render("#{FIXTURE_LOAD_PATH}/test/hello_world.erb") }
+ 3.times { assert_equal "Hello world!", render(:file => "#{FIXTURE_LOAD_PATH}/test/hello_world.erb") }
assert_equal 1, @compiled_templates.instance_methods.size
end