aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/components_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-03-13 04:46:12 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-03-13 04:46:12 +0000
commitda87839c895121b41ab9543c156439638df5b587 (patch)
treebc6117633d3799be889ff3dd79085f3fd88b762d /actionpack/test/controller/components_test.rb
parentee71950f60d3a775ed320dfb0ba50c6acb89ea01 (diff)
downloadrails-da87839c895121b41ab9543c156439638df5b587.tar.gz
rails-da87839c895121b41ab9543c156439638df5b587.tar.bz2
rails-da87839c895121b41ab9543c156439638df5b587.zip
Deprecation: remove toplevel components directory and uses_component_template_root.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/components_test.rb')
-rw-r--r--actionpack/test/controller/components_test.rb52
1 files changed, 15 insertions, 37 deletions
diff --git a/actionpack/test/controller/components_test.rb b/actionpack/test/controller/components_test.rb
index fbe4637536..81f1d17ea9 100644
--- a/actionpack/test/controller/components_test.rb
+++ b/actionpack/test/controller/components_test.rb
@@ -20,7 +20,7 @@ class CallerController < ActionController::Base
def internal_caller
render_template "Are you there? <%= render_component(:action => 'internal_callee') %>"
end
-
+
def internal_callee
render_text "Yes, ma'am"
end
@@ -32,11 +32,11 @@ 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') %>"
end
@@ -48,20 +48,20 @@ class CalleeController < ActionController::Base
def being_called
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"
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,12 @@ class ComponentsTest < Test::Unit::TestCase
get :calling_from_template
assert_equal "Ring, ring: Lady of the House, speaking", @response.body
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 +109,21 @@ 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
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
- 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
+ assert_equal "Lady of the House, speaking", @response.body
end
end