Merge pull request #794 from consul/not-found-pages

returns 404 for not found pages
This commit is contained in:
Raimond Garcia
2015-12-30 15:46:58 +01:00
2 changed files with 8 additions and 0 deletions

View File

@@ -3,5 +3,7 @@ class PagesController < ApplicationController
def show
render action: params[:id]
rescue ActionView::MissingTemplate
raise ActionController::RoutingError.new('Not Found')
end
end

View File

@@ -58,4 +58,10 @@ describe PagesController do
end
end
describe 'Not found pages' do
it 'should return a 404 message' do
expect { get :show, id: "nonExistentPage" }.to raise_error(ActionController::RoutingError)
end
end
end