diff --git a/lib/gollum/views/layout.rb b/lib/gollum/views/layout.rb index d6de7393..e2d14166 100644 --- a/lib/gollum/views/layout.rb +++ b/lib/gollum/views/layout.rb @@ -29,7 +29,7 @@ module Precious end def custom_path - "#{@base_url}#{@page_dir.nil? ? '' : '/'}#{@page_dir}" + "#{@base_url}#{@page_dir.empty? ? '' : '/'}#{@page_dir}" end def css # custom css diff --git a/test/test_app.rb b/test/test_app.rb index 454d4de3..6f1b7294 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -513,10 +513,23 @@ context "Frontend" do { :name => 'user1', :email => 'user1' }); get page - assert_match /custom.js/, last_response.body + assert_match /"\/custom.js"/, last_response.body Precious::App.set(:wiki_options, { :js => nil }) end + test "change custom.css path if page-file-dir is set" do + Precious::App.set(:wiki_options, { :css => true, :page_file_dir => 'docs'}) + page = 'docs/yaycustom' + text = 'customized!' + + @wiki.write_page(page, :markdown, text, + { :name => 'user1', :email => 'user1' }); + + get page + assert_match /"\/docs\/custom.css"/, last_response.body + Precious::App.set(:wiki_options, { :css => nil, :page_file_dir => nil }) + end + test "show edit page with header and footer and sidebar of multibyte" do post "/create", :content => 'りんご',