aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-11-05 15:50:30 +0000
committerGareth Rees <gareth@mysociety.org>2014-11-05 15:50:30 +0000
commitf2d0e81fd6f9b6ca688888edd1ea0e39fab0c0da (patch)
tree40126c9393932c999348f672ac805e2987d1f9f6
parente35662cd62c781b144d4154568ac7fa0b4c45d36 (diff)
Redirect /help to /help/about
Shouldn't really 404 on an important/accessible URL
-rw-r--r--app/controllers/help_controller.rb4
-rw-r--r--config/routes.rb1
-rw-r--r--spec/controllers/help_controller_spec.rb9
3 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index 9033198a0..93215ccad 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -11,6 +11,10 @@ class HelpController < ApplicationController
before_filter :long_cache
before_filter :catch_spam, :only => [:contact]
+ def index
+ redirect_to help_about_path
+ end
+
def unhappy
@info_request = nil
if params[:url_title]
diff --git a/config/routes.rb b/config/routes.rb
index ff99e884c..eabfb9053 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -155,6 +155,7 @@ Alaveteli::Application.routes.draw do
match '/help/api' => 'help#api', :as => :help_api
match '/help/credits' => 'help#credits', :as => :help_credits
match '/help/:action' => 'help#action', :as => :help_general
+ match '/help' => 'help#index'
####
#### Holiday controller
diff --git a/spec/controllers/help_controller_spec.rb b/spec/controllers/help_controller_spec.rb
index f92323f50..9453c9461 100644
--- a/spec/controllers/help_controller_spec.rb
+++ b/spec/controllers/help_controller_spec.rb
@@ -4,6 +4,15 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe HelpController do
render_views
+ describe :index do
+
+ it 'redirects to the about page' do
+ get :index
+ expect(response).to redirect_to(help_about_path)
+ end
+
+ end
+
describe :about do
it 'shows the about page' do