diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-20 22:09:12 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-20 22:09:12 +0000 |
commit | e1056530665d5c8eed2c325157fbb88553eb2678 (patch) | |
tree | 30341bae8b9a63faed289f9dc56c1a654a449731 /actionpack/test/controller | |
parent | 89cb34c9cfe9d169b79206b74c602e91bc7116a5 (diff) | |
download | rails-e1056530665d5c8eed2c325157fbb88553eb2678.tar.gz rails-e1056530665d5c8eed2c325157fbb88553eb2678.tar.bz2 rails-e1056530665d5c8eed2c325157fbb88553eb2678.zip |
Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/layout_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/controller/rescue_test.rb | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb index cade6738a7..edf8f44b3a 100644 --- a/actionpack/test/controller/layout_test.rb +++ b/actionpack/test/controller/layout_test.rb @@ -110,7 +110,9 @@ class ExemptFromLayoutTest < Test::Unit::TestCase def test_rhtml_exempt_from_layout_status_should_prevent_layout_render ActionController::Base.exempt_from_layout :rhtml + assert @controller.send(:template_exempt_from_layout?, 'test.rhtml') + assert @controller.send(:template_exempt_from_layout?, 'hello.rhtml') get :hello assert_equal 'hello.rhtml', @response.body diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index d3967791a0..3eb84e6d24 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -60,12 +60,12 @@ class NewRenderTestController < ActionController::Base def render_file_with_instance_variables @secret = 'in the sauce' - path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.rhtml') + path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb') render :file => path end def render_file_with_locals - path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.rhtml') + path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.erb') render :file => path, :locals => {:secret => 'in the sauce'} end @@ -227,11 +227,11 @@ class NewRenderTestController < ActionController::Base end def hello_world_from_rxml_using_action - render :action => "hello_world.rxml" + render :action => "hello_world.builder" end def hello_world_from_rxml_using_template - render :template => "test/hello_world.rxml" + render :template => "test/hello_world.builder" end def head_with_location_header diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index f539546a1a..885ac0b8c0 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -111,7 +111,7 @@ class RescueTest < Test::Unit::TestCase def test_rescue_action_locally get :raises assert_response :internal_server_error - assert_template 'diagnostics.rhtml' + assert_template 'diagnostics.erb' assert @response.body.include?('RescueController#raises'), "Response should include controller and action." assert @response.body.include?("don't panic"), "Response should include exception message." end |