[Frontend] Fixed bug that gave a bad redirect on page edit.
This commit is contained in:
@@ -57,7 +57,7 @@ module Precious
|
||||
post '/edit/*' do
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
page = wiki.page(params[:splat].first)
|
||||
name = params[:rename]
|
||||
name = params[:rename] || params[:page]
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = {:committer => committer}
|
||||
|
||||
|
||||
+4
-2
@@ -36,8 +36,9 @@ context "Frontend" do
|
||||
side_1 = page_1.sidebar
|
||||
|
||||
post "/edit/A",
|
||||
:footer => 'footer', :sidebar => 'sidebar', :message => 'def'
|
||||
:footer => 'footer', :page => "A", :sidebar => 'sidebar', :message => 'def'
|
||||
follow_redirect!
|
||||
assert_equal "/A", last_request.fullpath
|
||||
assert last_response.ok?
|
||||
|
||||
@wiki.clear_cache
|
||||
@@ -62,6 +63,7 @@ context "Frontend" do
|
||||
:rename => "C",
|
||||
:format => page_1.format, :message => 'def'
|
||||
follow_redirect!
|
||||
assert_equal "/C", last_request.fullpath
|
||||
assert last_response.ok?
|
||||
|
||||
@wiki.clear_cache
|
||||
@@ -139,4 +141,4 @@ context "Frontend" do
|
||||
def app
|
||||
Precious::App
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user