Permalink
Browse files

Merge pull request #331 from tjh/home-page-link-issue

Redirect from root to /Home, fixes #250
  • Loading branch information...
2 parents 2e73882 + 43d2143 commit d4e019ef42f291d657e792e7bfdcfe273f5b41a9 @bootstraponline bootstraponline committed Aug 9, 2012
Showing with 15 additions and 1 deletion.
  1. +1 −1 lib/gollum/frontend/app.rb
  2. +14 −0 test/test_app.rb
@@ -87,7 +87,7 @@ def supported_useragent?(user_agent)
end
get '/' do
- show_page_or_file('Home')
+ redirect File.join(settings.wiki_options[:base_path].to_s, 'Home')
end
# path is set to name if path is nil.
View
@@ -249,6 +249,20 @@
assert_equal page1.version.sha, page2.version.sha
end
+ test "redirects from 'base_path' or 'base_path/' to 'base_path/Home'" do
+ Precious::App.set(:wiki_options, {})
+ get "/"
+ assert_match "http://example.org/Home", last_response.headers['Location']
+
+ Precious::App.set(:wiki_options, { :base_path => '/wiki' })
+ get "/"
+ assert_match "http://example.org/wiki/Home", last_response.headers['Location']
+
+ Precious::App.set(:wiki_options, { :base_path => '/wiki/' })
+ get "/"
+ assert_match "http://example.org/wiki/Home", last_response.headers['Location']
+ end
+
def app
Precious::App
end

0 comments on commit d4e019e

Please sign in to comment.