diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ab8f2af53..bb0f17831 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -20,10 +20,4 @@ def allow_geoblacklight_params def after_message_create_path main_app.try(:root_path) || '/' end - - protected - - def not_found - raise ActionController::RoutingError.new('Not Found') - end end diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index 6557baa49..24b9fba69 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,9 +1,9 @@ class ErrorsController < ApplicationController def not_found - render status: 404, layout: 'blacklight', template: 'errors/not_found.html.erb' + render 'errors/not_found', status: :not_found end def internal_server_error - render status: 500, layout: 'blacklight', template: 'errors/internal_server_error.html.erb' + render 'errors/internal_server_error', status: :internal_server_error end -end +end \ No newline at end of file diff --git a/public/404.html b/public/404.html deleted file mode 100644 index b612547fc..000000000 --- a/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/public/500.html b/public/500.html deleted file mode 100644 index 061abc587..000000000 --- a/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/test/controllers/errors_controller_test.rb b/test/controllers/errors_controller_test.rb index aa6258bc0..f0727b305 100644 --- a/test/controllers/errors_controller_test.rb +++ b/test/controllers/errors_controller_test.rb @@ -1,19 +1,15 @@ require 'test_helper' class ErrorsControllerTest < ActionDispatch::IntegrationTest - test "bad facet id should return not_found" do - assert_raises(ActionController::RoutingError) do - get '/catalog/facet/about' - end - end - test "should get not_found" do get '/404' - assert_response :success + assert_response :not_found + assert_template 'errors/not_found' end test "should get internal_server_error" do get '/500' - assert_response :success + assert_response :internal_server_error + assert_template 'errors/internal_server_error' end -end +end \ No newline at end of file