From 71566c357308da8ab3fa86794ef57b853f99ce63 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sat, 14 Jan 2012 18:28:09 -0200 Subject: Remove rescue_action from compatibility module and tests --- actionpack/test/activerecord/active_record_store_test.rb | 10 ++++------ actionpack/test/controller/assert_select_test.rb | 4 ---- actionpack/test/controller/caching_test.rb | 4 ---- actionpack/test/controller/capture_test.rb | 2 -- actionpack/test/controller/content_type_test.rb | 2 -- actionpack/test/controller/filters_test.rb | 12 ------------ actionpack/test/controller/flash_test.rb | 4 ---- actionpack/test/controller/helper_test.rb | 7 ------- actionpack/test/controller/mime_responds_test.rb | 6 +----- actionpack/test/controller/redirect_test.rb | 2 -- actionpack/test/controller/render_test.rb | 4 ---- .../test/controller/request_forgery_protection_test.rb | 2 -- actionpack/test/controller/resources_test.rb | 1 - actionpack/test/controller/routing_test.rb | 1 - actionpack/test/controller/test_case_test.rb | 3 --- actionpack/test/controller/view_paths_test.rb | 1 - actionpack/test/controller/webservice_test.rb | 2 -- actionpack/test/dispatch/session/cache_store_test.rb | 2 -- actionpack/test/dispatch/session/cookie_store_test.rb | 2 -- actionpack/test/dispatch/session/mem_cache_store_test.rb | 2 -- actionpack/test/template/atom_feed_helper_test.rb | 7 +------ actionpack/test/template/url_helper_test.rb | 10 +--------- 22 files changed, 7 insertions(+), 83 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/activerecord/active_record_store_test.rb b/actionpack/test/activerecord/active_record_store_test.rb index 768ac713ca..2fe7959f5a 100644 --- a/actionpack/test/activerecord/active_record_store_test.rb +++ b/actionpack/test/activerecord/active_record_store_test.rb @@ -33,8 +33,6 @@ class ActiveRecordStoreTest < ActionDispatch::IntegrationTest session[:foo] = "baz" head :ok end - - def rescue_action(e) raise end end def setup @@ -225,16 +223,16 @@ class ActiveRecordStoreTest < ActionDispatch::IntegrationTest assert_equal session_id, cookies['_session_id'] end end - + def test_incoming_invalid_session_id_via_cookie_should_be_ignored with_test_route_set do open_session do |sess| sess.cookies['_session_id'] = 'INVALID' - + sess.get '/set_session_value' new_session_id = sess.cookies['_session_id'] assert_not_equal 'INVALID', new_session_id - + sess.get '/get_session_value' new_session_id_2 = sess.cookies['_session_id'] assert_equal new_session_id, new_session_id_2 @@ -248,7 +246,7 @@ class ActiveRecordStoreTest < ActionDispatch::IntegrationTest sess.get '/set_session_value', :_session_id => 'INVALID' new_session_id = sess.cookies['_session_id'] assert_not_equal 'INVALID', new_session_id - + sess.get '/get_session_value' new_session_id_2 = sess.cookies['_session_id'] assert_equal new_session_id, new_session_id_2 diff --git a/actionpack/test/controller/assert_select_test.rb b/actionpack/test/controller/assert_select_test.rb index 5eef8a32d7..d3359e79a6 100644 --- a/actionpack/test/controller/assert_select_test.rb +++ b/actionpack/test/controller/assert_select_test.rb @@ -47,10 +47,6 @@ class AssertSelectTest < ActionController::TestCase render :text=>@content, :layout=>false, :content_type=>Mime::XML @content = nil end - - def rescue_action(e) - raise e - end end tests AssertSelectController diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 443b56830a..bb4fb7bf07 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -793,10 +793,6 @@ class FunctionalCachingController < CachingController format.xml end end - - def rescue_action(e) - raise e - end end class FunctionalFragmentCachingTest < ActionController::TestCase diff --git a/actionpack/test/controller/capture_test.rb b/actionpack/test/controller/capture_test.rb index a217510434..72263156d9 100644 --- a/actionpack/test/controller/capture_test.rb +++ b/actionpack/test/controller/capture_test.rb @@ -28,8 +28,6 @@ class CaptureController < ActionController::Base def proper_block_detection @todo = "some todo" end - - def rescue_action(e) raise end end class CaptureTest < ActionController::TestCase diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb index a312b7c32a..b57f3f1bb5 100644 --- a/actionpack/test/controller/content_type_test.rb +++ b/actionpack/test/controller/content_type_test.rb @@ -48,8 +48,6 @@ class OldContentTypeController < ActionController::Base format.rss { render :text => "hello world!", :content_type => Mime::XML } end end - - def rescue_action(e) raise end end class ContentTypeTest < ActionController::TestCase diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 9ad0dc75f5..c64628890e 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -165,8 +165,6 @@ class FilterTest < ActionController::TestCase @ran_filter ||= [] @ran_filter << "clean_up_tmp" end - - def rescue_action(e) raise(e) end end class ConditionalCollectionFilterController < ConditionalFilterController @@ -454,11 +452,6 @@ class FilterTest < ActionController::TestCase def show raise ErrorToRescue.new("Something made the bad noise.") end - - private - def rescue_action(exception) - raise exception - end end class NonYieldingAroundFilterController < ActionController::Base @@ -472,9 +465,6 @@ class FilterTest < ActionController::TestCase render :inline => "index" end - #make sure the controller complains - def rescue_action(e); raise e; end - private def filter_one @@ -828,8 +818,6 @@ end class PostsController < ActionController::Base - def rescue_action(e); raise e; end - module AroundExceptions class Error < StandardError ; end class Before < Error ; end diff --git a/actionpack/test/controller/flash_test.rb b/actionpack/test/controller/flash_test.rb index d497913dc4..37ccc7a4a5 100644 --- a/actionpack/test/controller/flash_test.rb +++ b/actionpack/test/controller/flash_test.rb @@ -51,10 +51,6 @@ class FlashTest < ActionController::TestCase render :inline => "hello" end - def rescue_action(e) - raise unless ActionView::MissingTemplate === e - end - # methods for test_sweep_after_halted_filter_chain before_filter :halt_and_redir, :only => "filter_halting_action" diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb index 35a87c1aae..757661d8d0 100644 --- a/actionpack/test/controller/helper_test.rb +++ b/actionpack/test/controller/helper_test.rb @@ -7,16 +7,12 @@ module Fun def render_hello_world render :inline => "hello: <%= stratego %>" end - - def rescue_action(e) raise end end class PdfController < ActionController::Base def test render :inline => "test: <%= foobar %>" end - - def rescue_action(e) raise end end end @@ -60,7 +56,6 @@ class HelperTest < ActiveSupport::TestCase class TestController < ActionController::Base attr_accessor :delegate_attr def delegate_method() end - def rescue_action(e) raise end end def setup @@ -201,8 +196,6 @@ class IsolatedHelpersTest < ActiveSupport::TestCase def index render :inline => '<%= shout %>' end - - def rescue_action(e) raise end end class B < A diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index 76a8c89e60..60498822ff 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -151,10 +151,6 @@ class RespondToController < ActionController::Base end end - def rescue_action(e) - raise - end - protected def set_layout if action_name.in?(["all_types_with_layout", "iphone_with_html_response_type"]) @@ -498,7 +494,7 @@ class RespondToControllerTest < ActionController::TestCase assert_equal '
Hello iPhone future from iPhone!
', @response.body assert_equal "text/html", @response.content_type end - + def test_invalid_format get :using_defaults, :format => "invalidformat" assert_equal " ", @response.body diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index 5b739e49ac..b1d76150f8 100644 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -105,8 +105,6 @@ class RedirectController < ActionController::Base def rescue_errors(e) raise e end - def rescue_action(e) raise end - protected def dashbord_url(id, message) url_for :action => "dashboard", :params => { "id" => id, "message" => message } diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index bf04697b6a..8c2d622304 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -649,10 +649,6 @@ class TestController < ActionController::Base render :action => "calling_partial_with_layout", :layout => "layouts/partial_with_layout" end - def rescue_action(e) - raise - end - before_filter :only => :render_with_filters do request.format = :xml end diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb index fd5a41a0bb..4a291582d8 100644 --- a/actionpack/test/controller/request_forgery_protection_test.rb +++ b/actionpack/test/controller/request_forgery_protection_test.rb @@ -36,8 +36,6 @@ module RequestForgeryProtectionActions def form_for_without_protection render :inline => "<%= form_for(:some_resource, :authenticity_token => false ) {} %>" end - - def rescue_action(e) raise e end end # sample controllers diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 6b8a8f6161..73d72fe4d6 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -6,7 +6,6 @@ require 'active_support/core_ext/object/inclusion' class ResourcesController < ActionController::Base def index() render :nothing => true end alias_method :show, :index - def rescue_action(e) raise e end end class ThreadsController < ResourcesController; end diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index bf33b8cdd7..bec9eb16f3 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -6,7 +6,6 @@ require 'active_support/core_ext/object/with_options' class MilestonesController < ActionController::Base def index() head :ok end alias_method :show, :index - def rescue_action(e) raise e end end ROUTING = ActionDispatch::Routing diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index 34b06df8d8..d21cc24e85 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -124,9 +124,6 @@ XML end private - def rescue_action(e) - raise e - end def generate_url(opts) url_for(opts.merge(:action => "test_uri")) diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb index 77b928d368..40f6dc6f0f 100644 --- a/actionpack/test/controller/view_paths_test.rb +++ b/actionpack/test/controller/view_paths_test.rb @@ -3,7 +3,6 @@ require 'abstract_unit' class ViewLoadPathsTest < ActionController::TestCase class TestController < ActionController::Base def self.controller_path() "test" end - def rescue_action(e) raise end before_filter :add_view_path, :only => :hello_world_at_request_time diff --git a/actionpack/test/controller/webservice_test.rb b/actionpack/test/controller/webservice_test.rb index ae8588cbb0..351e61eeae 100644 --- a/actionpack/test/controller/webservice_test.rb +++ b/actionpack/test/controller/webservice_test.rb @@ -18,8 +18,6 @@ class WebServiceTest < ActionDispatch::IntegrationTest s << "#{k}#{value}" end end - - def rescue_action(e) raise end end def setup diff --git a/actionpack/test/dispatch/session/cache_store_test.rb b/actionpack/test/dispatch/session/cache_store_test.rb index 73e056de23..12405bf45d 100644 --- a/actionpack/test/dispatch/session/cache_store_test.rb +++ b/actionpack/test/dispatch/session/cache_store_test.rb @@ -30,8 +30,6 @@ class CacheStoreTest < ActionDispatch::IntegrationTest session[:bar] = "baz" head :ok end - - def rescue_action(e) raise end end def test_setting_and_getting_session_value diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb index 92df6967d6..19969394cd 100644 --- a/actionpack/test/dispatch/session/cookie_store_test.rb +++ b/actionpack/test/dispatch/session/cookie_store_test.rb @@ -54,8 +54,6 @@ class CookieStoreTest < ActionDispatch::IntegrationTest request.session_options[:renew] = true head :ok end - - def rescue_action(e) raise end end def test_setting_session_value diff --git a/actionpack/test/dispatch/session/mem_cache_store_test.rb b/actionpack/test/dispatch/session/mem_cache_store_test.rb index 8502bc547b..5277c92b55 100644 --- a/actionpack/test/dispatch/session/mem_cache_store_test.rb +++ b/actionpack/test/dispatch/session/mem_cache_store_test.rb @@ -31,8 +31,6 @@ class MemCacheStoreTest < ActionDispatch::IntegrationTest session[:bar] = "baz" head :ok end - - def rescue_action(e) raise end end begin diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb index 81d7444cf8..d26aa9aa85 100644 --- a/actionpack/test/template/atom_feed_helper_test.rb +++ b/actionpack/test/template/atom_feed_helper_test.rb @@ -16,7 +16,7 @@ class ScrollsController < ActionController::Base feed.title("My great blog!") feed.updated((@scrolls.first.created_at)) - @scrolls.each do |scroll| + @scrolls.each do |scroll| feed.entry(scroll) do |entry| entry.title(scroll.title) entry.content(scroll.body, :type => 'html') @@ -185,11 +185,6 @@ class ScrollsController < ActionController::Base render :inline => FEEDS[params[:id]], :type => :builder end - - protected - def rescue_action(e) - raise(e) - end end class AtomFeedTest < ActionController::TestCase diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index bc45fabf34..d013a44e6c 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -91,7 +91,7 @@ class UrlHelperTest < ActiveSupport::TestCase def test_button_to_with_remote_and_form_options assert_dom_equal "
", button_to("Hello", "http://www.example.com", :remote => true, :form => { :class => "custom-class", "data-type" => "json" } ) end - + def test_button_to_with_remote_and_javascript_confirm assert_dom_equal( "
", @@ -506,8 +506,6 @@ class UrlHelperControllerTest < ActionController::TestCase render :inline => '<%= url_for(:action => :show_url_for) %>' end - def rescue_action(e) raise e end - def override_url_helper render :inline => '<%= override_url_helper_path %>' end @@ -595,8 +593,6 @@ class TasksController < ActionController::Base render_default end - def rescue_action(e) raise e end - protected def render_default render :inline => @@ -655,8 +651,6 @@ class WorkshopsController < ActionController::Base @workshop = Workshop.new(params[:id]) render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>" end - - def rescue_action(e) raise e end end class SessionsController < ActionController::Base @@ -677,8 +671,6 @@ class SessionsController < ActionController::Base @session = Session.new(params[:id]) render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>" end - - def rescue_action(e) raise e end end class PolymorphicControllerTest < ActionController::TestCase -- cgit v1.2.3