diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 97493bfb..240dab43 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -44,7 +44,11 @@ class WikiController < ApplicationController end def export_html - export_pages_as_zip('html') { |page| @page = page; render_to_string 'wiki/print' } + export_pages_as_zip('html') do |page| + @page = page + @link_mode = :export + render_to_string 'wiki/print' + end end def export_markup @@ -149,6 +153,7 @@ class WikiController < ApplicationController end def print + @link_mode ||= :show # to template end diff --git a/app/views/wiki/print.rhtml b/app/views/wiki/print.rhtml index fd12c805..aaee6a87 100644 --- a/app/views/wiki/print.rhtml +++ b/app/views/wiki/print.rhtml @@ -10,5 +10,5 @@
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 45bb1de3..3f93cf45 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -102,6 +102,7 @@ class WikiControllerTest < Test::Unit::TestCase 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 @@ -233,8 +234,10 @@ class WikiControllerTest < Test::Unit::TestCase def test_print - process('print', 'web' => 'wiki1', 'id' => 'HomePage') + r = process('print', 'web' => 'wiki1', 'id' => 'HomePage') + assert_success + assert_equal :show, r.template_objects['link_mode'] end