fix previews
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user