Upgrade to Rails 2.0.2
Upgraded to Rails 2.0.2, except that we maintain vendor/rails/actionpack/lib/action_controller/routing.rb from Rail 1.2.6 (at least for now), so that Routes don't change. We still get to enjoy Rails's many new features. Also fixed a bug in Chunk-handling: disable WikiWord processing in tags (for real this time).
This commit is contained in:
parent
0f6889e09f
commit
6873fc8026
1083 changed files with 52810 additions and 41058 deletions
|
@ -14,15 +14,15 @@ class CallerController < ActionController::Base
|
|||
end
|
||||
|
||||
def calling_from_template
|
||||
render_template "Ring, ring: <%= render_component(:controller => 'callee', :action => 'being_called') %>"
|
||||
render :inline => "Ring, ring: <%= render_component(:controller => 'callee', :action => 'being_called') %>"
|
||||
end
|
||||
|
||||
def internal_caller
|
||||
render_template "Are you there? <%= render_component(:action => 'internal_callee') %>"
|
||||
render :inline => "Are you there? <%= render_component(:action => 'internal_callee') %>"
|
||||
end
|
||||
|
||||
|
||||
def internal_callee
|
||||
render_text "Yes, ma'am"
|
||||
render :text => "Yes, ma'am"
|
||||
end
|
||||
|
||||
def set_flash
|
||||
|
@ -32,13 +32,13 @@ class CallerController < ActionController::Base
|
|||
def use_flash
|
||||
render_component(:controller => "callee", :action => "use_flash")
|
||||
end
|
||||
|
||||
|
||||
def calling_redirected
|
||||
render_component(:controller => "callee", :action => "redirected")
|
||||
end
|
||||
|
||||
|
||||
def calling_redirected_as_string
|
||||
render_template "<%= render_component(:controller => 'callee', :action => 'redirected') %>"
|
||||
render :inline => "<%= render_component(:controller => 'callee', :action => 'redirected') %>"
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
|
@ -46,22 +46,22 @@ end
|
|||
|
||||
class CalleeController < ActionController::Base
|
||||
def being_called
|
||||
render_text "#{params[:name] || "Lady"} of the House, speaking"
|
||||
render :text => "#{params[:name] || "Lady"} of the House, speaking"
|
||||
end
|
||||
|
||||
|
||||
def blowing_up
|
||||
render_text "It's game over, man, just game over, man!", "500 Internal Server Error"
|
||||
render :text => "It's game over, man, just game over, man!", :status => 500
|
||||
end
|
||||
|
||||
|
||||
def set_flash
|
||||
flash[:notice] = 'My stoney baby'
|
||||
render :text => 'flash is set'
|
||||
end
|
||||
|
||||
|
||||
def use_flash
|
||||
render :text => flash[:notice] || 'no flash'
|
||||
end
|
||||
|
||||
|
||||
def redirected
|
||||
redirect_to :controller => "callee", :action => "being_called"
|
||||
end
|
||||
|
@ -85,7 +85,7 @@ class ComponentsTest < Test::Unit::TestCase
|
|||
get :calling_from_controller_with_params
|
||||
assert_equal "David of the House, speaking", @response.body
|
||||
end
|
||||
|
||||
|
||||
def test_calling_from_controller_with_different_status_code
|
||||
get :calling_from_controller_with_different_status_code
|
||||
assert_equal 500, @response.response_code
|
||||
|
@ -95,12 +95,18 @@ class ComponentsTest < Test::Unit::TestCase
|
|||
get :calling_from_template
|
||||
assert_equal "Ring, ring: Lady of the House, speaking", @response.body
|
||||
end
|
||||
|
||||
|
||||
def test_etag_is_set_for_parent_template_when_calling_from_template
|
||||
get :calling_from_template
|
||||
expected_etag = etag_for("Ring, ring: Lady of the House, speaking")
|
||||
assert_equal expected_etag, @response.headers['ETag']
|
||||
end
|
||||
|
||||
def test_internal_calling
|
||||
get :internal_caller
|
||||
assert_equal "Are you there? Yes, ma'am", @response.body
|
||||
end
|
||||
|
||||
|
||||
def test_flash
|
||||
get :set_flash
|
||||
assert_equal 'My stoney baby', flash[:notice]
|
||||
|
@ -109,43 +115,26 @@ class ComponentsTest < Test::Unit::TestCase
|
|||
get :use_flash
|
||||
assert_equal 'no flash', @response.body
|
||||
end
|
||||
|
||||
|
||||
def test_component_redirect_redirects
|
||||
get :calling_redirected
|
||||
|
||||
|
||||
assert_redirected_to :action => "being_called"
|
||||
end
|
||||
|
||||
|
||||
def test_component_multiple_redirect_redirects
|
||||
test_component_redirect_redirects
|
||||
test_internal_calling
|
||||
end
|
||||
|
||||
def test_component_as_string_redirect_renders_redirecte_action
|
||||
|
||||
def test_component_as_string_redirect_renders_redirected_action
|
||||
get :calling_redirected_as_string
|
||||
|
||||
|
||||
assert_equal "Lady of the House, speaking", @response.body
|
||||
end
|
||||
end
|
||||
|
||||
module A
|
||||
module B
|
||||
module C
|
||||
class NestedController < ActionController::Base
|
||||
# Stub for uses_component_template_root
|
||||
def self.caller
|
||||
[ '/path/to/active_support/deprecation.rb:93:in `uses_component_template_root',
|
||||
'./test/fixtures/a/b/c/nested_controller.rb' ]
|
||||
end
|
||||
end
|
||||
protected
|
||||
def etag_for(text)
|
||||
%("#{Digest::MD5.hexdigest(text)}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class UsesComponentTemplateRootTest < Test::Unit::TestCase
|
||||
def test_uses_component_template_root
|
||||
assert_deprecated 'uses_component_template_root' do
|
||||
assert_equal './test/fixtures/', A::B::C::NestedController.uses_component_template_root
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue