Skip to content

Commit

Permalink
Remove rescue_action from compatibility module and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed Jan 17, 2012
1 parent 1ae9e60 commit 71566c3
Show file tree
Hide file tree
Showing 23 changed files with 7 additions and 87 deletions.
4 changes: 0 additions & 4 deletions actionpack/lib/action_controller/metal/compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 4 additions & 6 deletions actionpack/test/activerecord/active_record_store_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def renew
session[:foo] = "baz"
head :ok
end

def rescue_action(e) raise end
end

def setup
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions actionpack/test/controller/assert_select_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions actionpack/test/controller/caching_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,6 @@ def formatted_fragment_cached
format.xml
end
end

def rescue_action(e)
raise e
end
end

class FunctionalFragmentCachingTest < ActionController::TestCase
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/controller/capture_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/controller/content_type_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions actionpack/test/controller/filters_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions actionpack/test/controller/flash_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 0 additions & 7 deletions actionpack/test/controller/helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -201,8 +196,6 @@ class A < ActionController::Base
def index
render :inline => '<%= shout %>'
end

def rescue_action(e) raise end
end

class B < A
Expand Down
6 changes: 1 addition & 5 deletions actionpack/test/controller/mime_responds_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/controller/redirect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 0 additions & 4 deletions actionpack/test/controller/render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/controller/request_forgery_protection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/resources_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/routing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions actionpack/test/controller/test_case_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/view_paths_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/controller/webservice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ def dump_params_keys(hash = params)
s << "#{k}#{value}"
end
end

def rescue_action(e) raise end
end

def setup
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/dispatch/session/cache_store_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/dispatch/session/cookie_store_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/dispatch/session/mem_cache_store_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def call_reset_session
session[:bar] = "baz"
head :ok
end

def rescue_action(e) raise end
end

begin
Expand Down
7 changes: 1 addition & 6 deletions actionpack/test/template/atom_feed_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions actionpack/test/template/url_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -595,8 +593,6 @@ def show
render_default
end

def rescue_action(e) raise e end

protected
def render_default
render :inline =>
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 71566c3

Please sign in to comment.