more helper tests

This commit is contained in:
tdreyno 2009-11-03 12:49:54 -08:00
parent 9dcac764e6
commit 191e972c44
2 changed files with 28 additions and 3 deletions

View file

@ -16,10 +16,10 @@ module Middleman
path << self.class.index_file if path.match(%r{/$})
path = path.gsub(%r{^/}, '')
path = path.gsub(File.extname(path), '')
path = path.gsub('/', '-')
css_file = File.join(File.basename(self.class.public), self.class.css_dir, "#{path}.css")
sass_file = File.join(File.basename(self.class.views), self.class.css_dir, "#{path}.css.sass")
css_file = File.join(self.class.public, self.class.css_dir, "#{path}.css")
sass_file = File.join(self.class.views, self.class.css_dir, "#{path}.css.sass")
if File.exists?(css_file) || File.exists?(sass_file)
stylesheet_link_tag "#{path}.css"
end

View file

@ -2,3 +2,28 @@
get "/inline-js.html" do
haml :"inline-js.html", :layout => false
end
get "/page-class.html" do
haml :"page-classes.html", :layout => false
end
get "/sub1/page-class.html" do
haml :"page-classes.html", :layout => false
end
get "/sub1/sub2/page-class.html" do
haml :"page-classes.html", :layout => false
end
get "/auto-css.html" do
haml :"auto-css.html", :layout => false
end
get "/sub1/auto-css.html" do
haml :"auto-css.html", :layout => false
end
get "/sub1/sub2/auto-css.html" do
haml :"auto-css.html", :layout => false
end