Redirect from root to /Home, fixes #250
This commit is contained in:
@@ -39,7 +39,7 @@ module Precious
|
||||
end
|
||||
|
||||
get '/' do
|
||||
show_page_or_file('Home')
|
||||
redirect File.join(settings.wiki_options[:base_path].to_s, 'Home')
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
|
||||
@@ -167,6 +167,20 @@ context "Frontend" do
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user