Always display our custom 404 page
This commit is contained in:
parent
be4d679d54
commit
3f99ee63ff
|
@ -65,6 +65,9 @@ class ApplicationController < ActionController::Base
|
||||||
filter_parameter_logging :password
|
filter_parameter_logging :password
|
||||||
|
|
||||||
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
|
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
|
||||||
|
# FIXME: This doesn't work with Rails >= 3.0 anymore
|
||||||
|
# Possible workaround: https://github.com/rails/rails/issues/671#issuecomment-1780159
|
||||||
|
rescue_from ActionController::RoutingError, :with => proc{render_404}
|
||||||
|
|
||||||
include Redmine::Search::Controller
|
include Redmine::Search::Controller
|
||||||
include Redmine::MenuManager::MenuController
|
include Redmine::MenuManager::MenuController
|
||||||
|
|
|
@ -436,8 +436,8 @@ module ApplicationHelper
|
||||||
css << 'theme-' + theme.name
|
css << 'theme-' + theme.name
|
||||||
end
|
end
|
||||||
|
|
||||||
css << 'controller-' + params[:controller]
|
css << 'controller-' + params[:controller] if params[:controller]
|
||||||
css << 'action-' + params[:action]
|
css << 'action-' + params[:action] if params[:action]
|
||||||
css.join(' ')
|
css.join(' ')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -49,4 +49,13 @@ class ApplicationTest < ActionController::IntegrationTest
|
||||||
assert_response 200
|
assert_response 200
|
||||||
assert_nil session[:user_id]
|
assert_nil session[:user_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_always_use_custom_404
|
||||||
|
get 'something_not_existing'
|
||||||
|
assert_response :not_found
|
||||||
|
|
||||||
|
assert_tag :tag => 'p',
|
||||||
|
:attributes => {:id => 'errorExplanation'},
|
||||||
|
:content => "The page you were trying to access doesn't exist or has been removed."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue