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
post '/preview' do
@name = params['page']
format = params['format']
data = params['content']
wiki = Gollum::Wiki.new(settings.gollum_path)
@page = wiki.preview_page("Preview", data, format)
wiki = Gollum::Wiki.new(settings.gollum_path)
@name = "Preview"
@page = wiki.preview_page(@name, params[:content], params[:format])
@content = @page.formatted_data
mustache :page
end
+4
View File
@@ -39,6 +39,10 @@ context "Frontend" do
assert_equal 'def', page.version.message
end
test "previews content" do
post "/preview", :content => 'abc', :format => 'markdown'
end
def app
Precious::App
end