Got all the dispatch tests running on new base
This commit is contained in:
parent
1358f77745
commit
a1f280e83d
|
@ -59,12 +59,13 @@ end
|
||||||
desc 'Old Controller Tests on New Base'
|
desc 'Old Controller Tests on New Base'
|
||||||
Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
|
Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
|
||||||
t.libs << "test/new_base" << "test/lib"
|
t.libs << "test/new_base" << "test/lib"
|
||||||
# layout
|
|
||||||
# Dir.glob( "test/{dispatch,template}/**/*_test.rb" ).sort +
|
|
||||||
|
|
||||||
|
t.verbose = true
|
||||||
# ==== Not ported
|
# ==== Not ported
|
||||||
# * filters
|
# * filters
|
||||||
t.test_files = %w(
|
|
||||||
|
# Dir.glob( "test/{dispatch,template}/**/*_test.rb" ).sort +
|
||||||
|
t.test_files = Dir.glob( "test/{dispatch}/**/*_test.rb" ).sort + %w(
|
||||||
action_pack_assertions addresses_render assert_select
|
action_pack_assertions addresses_render assert_select
|
||||||
base benchmark caching capture content_type cookie dispatcher
|
base benchmark caching capture content_type cookie dispatcher
|
||||||
filter_params flash helper http_basic_authentication
|
filter_params flash helper http_basic_authentication
|
||||||
|
@ -74,7 +75,6 @@ Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
|
||||||
resources routing selector send_file test url_rewriter
|
resources routing selector send_file test url_rewriter
|
||||||
verification view_paths webservice
|
verification view_paths webservice
|
||||||
).map { |name| "test/controller/#{name}_test.rb" }
|
).map { |name| "test/controller/#{name}_test.rb" }
|
||||||
t.verbose = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Genereate the RDoc documentation
|
# Genereate the RDoc documentation
|
||||||
|
|
|
@ -61,6 +61,9 @@ module ActionController
|
||||||
# and images to a dedicated asset server away from the main web server. Example:
|
# and images to a dedicated asset server away from the main web server. Example:
|
||||||
# ActionController::Base.asset_host = "http://assets.example.com"
|
# ActionController::Base.asset_host = "http://assets.example.com"
|
||||||
cattr_accessor :asset_host
|
cattr_accessor :asset_host
|
||||||
|
|
||||||
|
cattr_accessor :ip_spoofing_check
|
||||||
|
self.ip_spoofing_check = true
|
||||||
end
|
end
|
||||||
|
|
||||||
# For old tests
|
# For old tests
|
||||||
|
|
|
@ -10,7 +10,8 @@ module ActionDispatch
|
||||||
@@rescue_responses = Hash.new(:internal_server_error)
|
@@rescue_responses = Hash.new(:internal_server_error)
|
||||||
@@rescue_responses.update({
|
@@rescue_responses.update({
|
||||||
'ActionController::RoutingError' => :not_found,
|
'ActionController::RoutingError' => :not_found,
|
||||||
'ActionController::UnknownAction' => :not_found,
|
# TODO: Clean this up after the switch
|
||||||
|
ActionController::UnknownAction.name => :not_found,
|
||||||
'ActiveRecord::RecordNotFound' => :not_found,
|
'ActiveRecord::RecordNotFound' => :not_found,
|
||||||
'ActiveRecord::StaleObjectError' => :conflict,
|
'ActiveRecord::StaleObjectError' => :conflict,
|
||||||
'ActiveRecord::RecordInvalid' => :unprocessable_entity,
|
'ActiveRecord::RecordInvalid' => :unprocessable_entity,
|
||||||
|
@ -23,10 +24,10 @@ module ActionDispatch
|
||||||
cattr_accessor :rescue_templates
|
cattr_accessor :rescue_templates
|
||||||
@@rescue_templates = Hash.new('diagnostics')
|
@@rescue_templates = Hash.new('diagnostics')
|
||||||
@@rescue_templates.update({
|
@@rescue_templates.update({
|
||||||
'ActionView::MissingTemplate' => 'missing_template',
|
'ActionView::MissingTemplate' => 'missing_template',
|
||||||
'ActionController::RoutingError' => 'routing_error',
|
'ActionController::RoutingError' => 'routing_error',
|
||||||
'ActionController::UnknownAction' => 'unknown_action',
|
ActionController::UnknownAction.name => 'unknown_action',
|
||||||
'ActionView::TemplateError' => 'template_error'
|
'ActionView::TemplateError' => 'template_error'
|
||||||
})
|
})
|
||||||
|
|
||||||
FAILSAFE_RESPONSE = [500, {'Content-Type' => 'text/html'},
|
FAILSAFE_RESPONSE = [500, {'Content-Type' => 'text/html'},
|
||||||
|
|
|
@ -61,7 +61,7 @@ class ShowExceptionsTest < ActionController::IntegrationTest
|
||||||
|
|
||||||
get "/not_found"
|
get "/not_found"
|
||||||
assert_response 404
|
assert_response 404
|
||||||
assert_match /ActionController::UnknownAction/, body
|
assert_match /#{ActionController::UnknownAction.name}/, body
|
||||||
|
|
||||||
get "/method_not_allowed"
|
get "/method_not_allowed"
|
||||||
assert_response 405
|
assert_response 405
|
||||||
|
@ -99,7 +99,7 @@ class ShowExceptionsTest < ActionController::IntegrationTest
|
||||||
|
|
||||||
get "/not_found"
|
get "/not_found"
|
||||||
assert_response 404
|
assert_response 404
|
||||||
assert_match /ActionController::UnknownAction/, body
|
assert_match /#{ActionController::UnknownAction.name}/, body
|
||||||
|
|
||||||
get "/method_not_allowed"
|
get "/method_not_allowed"
|
||||||
assert_response 405
|
assert_response 405
|
||||||
|
|
Loading…
Reference in New Issue