Fix custom.x path when page-file-dir is not set

This commit is contained in:
Matt Hill
2015-08-20 23:19:25 -04:00
parent f3405851a7
commit 51b5a11a54
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -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
+14 -1
View File
@@ -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 => 'りんご',