fix previews

This commit is contained in:
rick
2010-12-09 16:15:28 -08:00
parent 2c8be3d95b
commit f5480c21d2
2 changed files with 7 additions and 5 deletions
+3 -5
View File
@@ -81,11 +81,9 @@ module Precious
end end
post '/preview' do post '/preview' do
@name = params['page'] wiki = Gollum::Wiki.new(settings.gollum_path)
format = params['format'] @name = "Preview"
data = params['content'] @page = wiki.preview_page(@name, params[:content], params[:format])
wiki = Gollum::Wiki.new(settings.gollum_path)
@page = wiki.preview_page("Preview", data, format)
@content = @page.formatted_data @content = @page.formatted_data
mustache :page mustache :page
end end
+4
View File
@@ -39,6 +39,10 @@ context "Frontend" do
assert_equal 'def', page.version.message assert_equal 'def', page.version.message
end end
test "previews content" do
post "/preview", :content => 'abc', :format => 'markdown'
end
def app def app
Precious::App Precious::App
end end