aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/layout_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-04-28 23:29:29 -0500
committerJoshua Peek <josh@joshpeek.com>2009-04-28 23:29:46 -0500
commitc0a372ba87f556769b98a6d06e8c684c3c3156df (patch)
treeac64ad4c56383731ba822088ffe4a697e77ef4ac /actionpack/test/controller/layout_test.rb
parent8925e89c6307b8b7c8aeb0277ae5e059904b2fc6 (diff)
downloadrails-c0a372ba87f556769b98a6d06e8c684c3c3156df.tar.gz
rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.tar.bz2
rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.zip
Deprecate template, session, assigns, and layout accessors on response object. Instead access them through the controller instance. This mainly affects functional test assertions.
Diffstat (limited to 'actionpack/test/controller/layout_test.rb')
-rw-r--r--actionpack/test/controller/layout_test.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 11559b4071..da3f7b0cb8 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -57,7 +57,7 @@ class LayoutAutoDiscoveryTest < ActionController::TestCase
@controller = ThirdPartyTemplateLibraryController.new
get :hello
assert @controller.active_layout(true).identifier.include?('layouts/third_party_template_library.mab')
- assert @response.layout.include?('layouts/third_party_template_library')
+ assert @controller.template.layout.include?('layouts/third_party_template_library')
assert_response :success
assert_equal 'Mab', @response.body
end
@@ -121,49 +121,49 @@ class LayoutSetInResponseTest < ActionController::TestCase
def test_layout_set_when_using_default_layout
@controller = DefaultLayoutController.new
get :hello
- assert @response.layout.include?('layouts/layout_test')
+ assert @controller.template.layout.include?('layouts/layout_test')
end
def test_layout_set_when_set_in_controller
@controller = HasOwnLayoutController.new
get :hello
- assert @response.layout.include?('layouts/item')
+ assert @controller.template.layout.include?('layouts/item')
end
def test_layout_only_exception_when_included
@controller = OnlyLayoutController.new
get :hello
- assert @response.layout.include?('layouts/item')
+ assert @controller.template.layout.include?('layouts/item')
end
def test_layout_only_exception_when_excepted
@controller = OnlyLayoutController.new
get :goodbye
- assert_equal nil, @response.layout
+ assert_equal nil, @controller.template.layout
end
def test_layout_except_exception_when_included
@controller = ExceptLayoutController.new
get :hello
- assert @response.layout.include?('layouts/item')
+ assert @controller.template.layout.include?('layouts/item')
end
def test_layout_except_exception_when_excepted
@controller = ExceptLayoutController.new
get :goodbye
- assert_equal nil, @response.layout
+ assert_equal nil, @controller.template.layout
end
def test_layout_set_when_using_render
@controller = SetsLayoutInRenderController.new
get :hello
- assert @response.layout.include?('layouts/third_party_template_library')
+ assert @controller.template.layout.include?('layouts/third_party_template_library')
end
def test_layout_is_not_set_when_none_rendered
@controller = RendersNoLayoutController.new
get :hello
- assert_nil @response.layout
+ assert_nil @controller.template.layout
end
def test_exempt_from_layout_honored_by_render_template
@@ -181,7 +181,7 @@ class LayoutSetInResponseTest < ActionController::TestCase
pending do
@controller = PrependsViewPathController.new
get :hello
- assert_equal 'layouts/alt', @response.layout
+ assert_equal 'layouts/alt', @controller.template.layout
end
end
@@ -206,7 +206,7 @@ class LayoutExceptionRaised < ActionController::TestCase
def test_exception_raised_when_layout_file_not_found
@controller = SetsNonExistentLayoutFile.new
get :hello
- assert_kind_of ActionView::MissingTemplate, @response.template.instance_eval { @exception }
+ assert_kind_of ActionView::MissingTemplate, @controller.template.instance_eval { @exception }
end
end
@@ -234,7 +234,7 @@ unless RUBY_PLATFORM =~ /(:?mswin|mingw|bccwin)/
@controller = LayoutSymlinkedTest.new
get :hello
assert_response 200
- assert @response.layout.include?("layouts/symlinked/symlinked_layout")
+ assert @controller.template.layout.include?("layouts/symlinked/symlinked_layout")
end
end
end