Export with no layout option in the export_html
This commit is contained in:
parent
d3fc0c40a2
commit
8827f61b70
|
@ -49,7 +49,7 @@ class WikiController < ApplicationController
|
|||
export_pages_as_zip('html') do |page|
|
||||
@page = page
|
||||
@link_mode = :export
|
||||
render_to_string('wiki/print', use_layout = true)
|
||||
render_to_string('wiki/print', use_layout = (@params['layout'] != 'no'))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -117,6 +117,20 @@ class WikiControllerTest < Test::Unit::TestCase
|
|||
assert_equal :export, r.template_objects['link_mode']
|
||||
end
|
||||
|
||||
def test_export_html_no_layout
|
||||
setup_wiki_with_three_pages
|
||||
|
||||
r = process 'export_html', 'web' => 'wiki1', 'layout' => 'no'
|
||||
|
||||
assert_success
|
||||
assert_equal 'application/zip', r.headers['Content-Type']
|
||||
assert_match /attachment; filename="wiki1-html-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.zip"/,
|
||||
r.headers['Content-Disposition']
|
||||
content = r.binary_content
|
||||
assert_equal 'PK', content[0..1], 'Content is not a zip file'
|
||||
assert_equal :export, r.template_objects['link_mode']
|
||||
end
|
||||
|
||||
def test_export_markup
|
||||
r = process 'export_markup', 'web' => 'wiki1'
|
||||
|
||||
|
|
Loading…
Reference in a new issue