aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-15 23:21:08 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-17 18:07:08 -0200
commit20baeece919629b7e43b86aebb05f8e2af6d19ef (patch)
tree2b3516ccb6f5cdf7571a75d82797b71eb7ca1986 /actionpack/test/controller
parent57f73a6bcf3311262172f1f348a1be614596b41a (diff)
downloadrails-20baeece919629b7e43b86aebb05f8e2af6d19ef.tar.gz
rails-20baeece919629b7e43b86aebb05f8e2af6d19ef.tar.bz2
rails-20baeece919629b7e43b86aebb05f8e2af6d19ef.zip
Add some deprecations for logic being removed in 4.0
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/base_test.rb12
-rw-r--r--actionpack/test/controller/caching_test.rb2
-rw-r--r--actionpack/test/controller/render_test.rb2
-rw-r--r--actionpack/test/controller/view_paths_test.rb7
4 files changed, 10 insertions, 13 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index f2b054c849..b11fc02604 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -161,7 +161,9 @@ class PerformActionTest < ActionController::TestCase
def test_get_on_priv_should_show_selector
use_controller MethodMissingController
- get :shouldnt_be_called
+ assert_deprecated /Using `method_missing` to handle .* use `action_missing` instead/ do
+ get :shouldnt_be_called
+ end
assert_response :success
assert_equal 'shouldnt_be_called', @response.body
end
@@ -170,14 +172,18 @@ class PerformActionTest < ActionController::TestCase
use_controller MethodMissingController
assert !@controller.__send__(:action_method?, 'method_missing')
- get :method_missing
+ assert_deprecated /Using `method_missing` to handle .* use `action_missing` instead/ do
+ get :method_missing
+ end
assert_response :success
assert_equal 'method_missing', @response.body
end
def test_method_missing_should_recieve_symbol
use_controller AnotherMethodMissingController
- get :some_action
+ assert_deprecated /Using `method_missing` to handle .* use `action_missing` instead/ do
+ get :some_action
+ end
assert_kind_of NameError, @controller._exception
end
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 34a38a5567..443b56830a 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -686,8 +686,6 @@ class FragmentCachingTest < ActionController::TestCase
@controller.params = @params
@controller.request = @request
@controller.response = @response
- @controller.send(:initialize_template_class, @response)
- @controller.send(:assign_shortcuts, @request, @response)
end
def test_fragment_cache_key
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index f42a04d670..0bac073154 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -54,7 +54,7 @@ class TestController < ActionController::Base
def conditional_hello_with_record
record = Struct.new(:updated_at, :cache_key).new(Time.now.utc.beginning_of_day, "foo/123")
-
+
if stale?(record)
render :action => 'hello_world'
end
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb
index f5ac886c20..04f550ae1e 100644
--- a/actionpack/test/controller/view_paths_test.rb
+++ b/actionpack/test/controller/view_paths_test.rb
@@ -22,16 +22,9 @@ class ViewLoadPathsTest < ActionController::TestCase
end
def setup
- # TestController.view_paths = nil
-
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
-
@controller = TestController.new
- # Following is needed in order to setup @controller.template object properly
- @controller.send :assign_shortcuts, @request, @response
- @controller.send :initialize_template_class, @response
-
@paths = TestController.view_paths
end