@included_wiki_pages ||= []
raise 'Circular inclusion detected' if @included_wiki_pages.include?(page.title)
@included_wiki_pages << page.title
- out = textilizable(page.content, :text)
+ out = textilizable(page.content, :text, :attachments => page.attachments)
@included_wiki_pages.pop
out
else
filesize: 28\r
filename: document.txt\r
author_id: 2\r
+attachments_003: \r
+ created_on: 2006-07-19 21:07:27 +02:00\r
+ downloads: 0\r
+ content_type: image/gif\r
+ disk_filename: 060719210727_logo.gif\r
+ container_id: 4\r
+ digest: b91e08d0cf966d5c6ff411bd8c4cc3a2\r
+ id: 3\r
+ container_type: WikiPage\r
+ filesize: 280\r
+ filename: logo.gif\r
+ author_id: 2\r
\ No newline at end of file
h1. Another page\r
\r
This is a link to a ticket: #2\r
+ And this is an included page:\r
+ {{include(Page with an inline image)}}\r
updated_on: 2007-03-08 00:18:07 +01:00\r
page_id: 2\r
id: 2\r
version: 1\r
author_id: 1\r
comments: \r
+wiki_contents_004: \r
+ text: |-\r
+ h1. Page with an inline image\r
+ \r
+ This is an inline image:\r
+ \r
+ !logo.gif!\r
+ updated_on: 2007-03-08 00:18:07 +01:00\r
+ page_id: 4\r
+ id: 4\r
+ version: 1\r
+ author_id: 1\r
+ comments: \r
+
\ No newline at end of file
class WikiController; def rescue_action(e) raise e end; end
class WikiControllerTest < Test::Unit::TestCase
- fixtures :projects, :users, :roles, :members, :enabled_modules, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
+ fixtures :projects, :users, :roles, :members, :enabled_modules, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions, :attachments
def setup
@controller = WikiController.new
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /Another page/
+ # Included page with an inline image
+ assert_tag :tag => 'p', :content => /This is an inline image/
+ assert_tag :tag => 'img', :attributes => { :src => '/attachments/download/3' }
end
def test_show_unexistent_page_without_edit_right
assert_template 'special_page_index'
pages = assigns(:pages)
assert_not_nil pages
- assert_equal 2, pages.size
+ assert_equal Project.find(1).wiki.pages.size, pages.size
assert_tag :tag => 'a', :attributes => { :href => '/wiki/ecookbook/CookBook_documentation' },
:content => /CookBook documentation/
end