diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 6ee46f60..4dac5b4f 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -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} diff --git a/test/test_app.rb b/test/test_app.rb index 4380615b..b68c5da5 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -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 \ No newline at end of file +end