Export with no layout option in the export_html

This commit is contained in:
Alexey Verkhovsky 2005-05-03 02:13:42 +00:00
parent d3fc0c40a2
commit 8827f61b70
2 changed files with 15 additions and 1 deletions

View file

@ -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

View file

@ -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'