Remove rescue_action from compatibility module and tests
This commit is contained in:
parent
1ae9e60b8a
commit
71566c3573
@ -16,10 +16,6 @@ class << self
|
||||
:@_status, :@_headers, :@_params, :@_env, :@_response, :@_request,
|
||||
:@_view_runtime, :@_stream, :@_url_options, :@_action_has_layout
|
||||
]
|
||||
|
||||
def rescue_action(env)
|
||||
raise env["action_dispatch.rescue.exception"]
|
||||
end
|
||||
end
|
||||
|
||||
def _normalize_options(options)
|
||||
|
@ -33,8 +33,6 @@ def renew
|
||||
session[:foo] = "baz"
|
||||
head :ok
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
def setup
|
||||
@ -225,16 +223,16 @@ def test_allows_session_fixation
|
||||
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 @@ def test_incoming_invalid_session_id_via_parameter_should_be_ignored
|
||||
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
|
||||
|
@ -47,10 +47,6 @@ def xml()
|
||||
render :text=>@content, :layout=>false, :content_type=>Mime::XML
|
||||
@content = nil
|
||||
end
|
||||
|
||||
def rescue_action(e)
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
tests AssertSelectController
|
||||
|
@ -793,10 +793,6 @@ def formatted_fragment_cached
|
||||
format.xml
|
||||
end
|
||||
end
|
||||
|
||||
def rescue_action(e)
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
class FunctionalFragmentCachingTest < ActionController::TestCase
|
||||
|
@ -28,8 +28,6 @@ def non_erb_block_content_for
|
||||
def proper_block_detection
|
||||
@todo = "some todo"
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
class CaptureTest < ActionController::TestCase
|
||||
|
@ -48,8 +48,6 @@ def render_default_content_types_for_respond_to
|
||||
format.rss { render :text => "hello world!", :content_type => Mime::XML }
|
||||
end
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
class ContentTypeTest < ActionController::TestCase
|
||||
|
@ -165,8 +165,6 @@ def clean_up_tmp
|
||||
@ran_filter ||= []
|
||||
@ran_filter << "clean_up_tmp"
|
||||
end
|
||||
|
||||
def rescue_action(e) raise(e) end
|
||||
end
|
||||
|
||||
class ConditionalCollectionFilterController < ConditionalFilterController
|
||||
@ -454,11 +452,6 @@ class RescuedController < ActionController::Base
|
||||
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 @@ def index
|
||||
render :inline => "index"
|
||||
end
|
||||
|
||||
#make sure the controller complains
|
||||
def rescue_action(e); raise e; end
|
||||
|
||||
private
|
||||
|
||||
def filter_one
|
||||
@ -828,8 +818,6 @@ def test_process(controller, action = "show")
|
||||
|
||||
|
||||
class PostsController < ActionController::Base
|
||||
def rescue_action(e); raise e; end
|
||||
|
||||
module AroundExceptions
|
||||
class Error < StandardError ; end
|
||||
class Before < Error ; end
|
||||
|
@ -51,10 +51,6 @@ def use_flash_after_reset_session
|
||||
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"
|
||||
|
||||
|
@ -7,16 +7,12 @@ class GamesController < ActionController::Base
|
||||
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 A < ActionController::Base
|
||||
def index
|
||||
render :inline => '<%= shout %>'
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
class B < A
|
||||
|
@ -151,10 +151,6 @@ def iphone_with_html_response_type_without_layout
|
||||
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 @@ def test_format_with_custom_response_type_and_request_headers
|
||||
assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>', @response.body
|
||||
assert_equal "text/html", @response.content_type
|
||||
end
|
||||
|
||||
|
||||
def test_invalid_format
|
||||
get :using_defaults, :format => "invalidformat"
|
||||
assert_equal " ", @response.body
|
||||
|
@ -105,8 +105,6 @@ def redirect_to_with_block_and_options
|
||||
|
||||
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 }
|
||||
|
@ -649,10 +649,6 @@ def render_call_to_partial_with_layout_in_main_layout_and_within_content_for_lay
|
||||
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
|
||||
|
@ -36,8 +36,6 @@ def external_form_for
|
||||
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
|
||||
|
@ -6,7 +6,6 @@
|
||||
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
|
||||
|
@ -6,7 +6,6 @@
|
||||
class MilestonesController < ActionController::Base
|
||||
def index() head :ok end
|
||||
alias_method :show, :index
|
||||
def rescue_action(e) raise e end
|
||||
end
|
||||
|
||||
ROUTING = ActionDispatch::Routing
|
||||
|
@ -124,9 +124,6 @@ def test_assigns
|
||||
end
|
||||
|
||||
private
|
||||
def rescue_action(e)
|
||||
raise e
|
||||
end
|
||||
|
||||
def generate_url(opts)
|
||||
url_for(opts.merge(:action => "test_uri"))
|
||||
|
@ -3,7 +3,6 @@
|
||||
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
|
||||
|
||||
|
@ -18,8 +18,6 @@ def dump_params_keys(hash = params)
|
||||
s << "#{k}#{value}"
|
||||
end
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
def setup
|
||||
|
@ -30,8 +30,6 @@ def call_reset_session
|
||||
session[:bar] = "baz"
|
||||
head :ok
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
def test_setting_and_getting_session_value
|
||||
|
@ -54,8 +54,6 @@ def renew_session_id
|
||||
request.session_options[:renew] = true
|
||||
head :ok
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
def test_setting_session_value
|
||||
|
@ -31,8 +31,6 @@ def call_reset_session
|
||||
session[:bar] = "baz"
|
||||
head :ok
|
||||
end
|
||||
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
begin
|
||||
|
@ -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 @@ def index
|
||||
|
||||
render :inline => FEEDS[params[:id]], :type => :builder
|
||||
end
|
||||
|
||||
protected
|
||||
def rescue_action(e)
|
||||
raise(e)
|
||||
end
|
||||
end
|
||||
|
||||
class AtomFeedTest < ActionController::TestCase
|
||||
|
@ -91,7 +91,7 @@ def test_button_to_with_javascript_disable_with
|
||||
def test_button_to_with_remote_and_form_options
|
||||
assert_dom_equal "<form method=\"post\" action=\"http://www.example.com\" class=\"custom-class\" data-remote=\"true\" data-type=\"json\"><div><input type=\"submit\" value=\"Hello\" /></div></form>", 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(
|
||||
"<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\" data-remote=\"true\"><div><input data-confirm=\"Are you sure?\" type=\"submit\" value=\"Hello\" /></div></form>",
|
||||
@ -506,8 +506,6 @@ def recall_params_not_changed
|
||||
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 @@ def show
|
||||
render_default
|
||||
end
|
||||
|
||||
def rescue_action(e) raise e end
|
||||
|
||||
protected
|
||||
def render_default
|
||||
render :inline =>
|
||||
@ -655,8 +651,6 @@ def show
|
||||
@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 @@ def show
|
||||
@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
|
||||
|
Loading…
Reference in New Issue
Block a user