/wiki/published renders a home page
This commit is contained in:
parent
cbca2ba318
commit
709d28dc4b
2 changed files with 13 additions and 4 deletions
|
@ -205,11 +205,11 @@ class WikiController < ApplicationController
|
|||
return
|
||||
end
|
||||
|
||||
page_name = @page_name || 'HomePage'
|
||||
page = wiki.read_page(@web_name, page_name)
|
||||
render(:text => "Page '#{page_name}' not found", :status => 404) and return unless page
|
||||
@page_name ||= 'HomePage'
|
||||
@page ||= wiki.read_page(@web_name, @page_name)
|
||||
render(:text => "Page '#{@page_name}' not found", :status => 404) and return unless @page
|
||||
|
||||
@renderer = PageRenderer.new(page.revisions.last)
|
||||
@renderer = PageRenderer.new(@page.revisions.last)
|
||||
end
|
||||
|
||||
def revision
|
||||
|
|
|
@ -293,6 +293,15 @@ class WikiControllerTest < Test::Unit::TestCase
|
|||
assert_response :missing
|
||||
end
|
||||
|
||||
def test_published_should_render_homepage_if_no_page_specified
|
||||
set_web_property :published, true
|
||||
|
||||
r = process('published', 'web' => 'wiki1')
|
||||
|
||||
assert_success
|
||||
assert_equal @home, r.template_objects['page']
|
||||
end
|
||||
|
||||
|
||||
def test_recently_revised
|
||||
r = process('recently_revised', 'web' => 'wiki1')
|
||||
|
|
Loading…
Reference in a new issue