1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Add a template test for partial layout rendering.

This commit is contained in:
Mislav Marohnić 2008-09-22 00:31:55 +02:00 committed by Nathan Weizenbaum
parent 998578aed6
commit e4e1ba2828
4 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,5 @@
<h1>Partial layout used with for block:</h1>
<div class='partial-layout'>
<h2>This is inside a partial layout</h2>
<p>Some content within a layout</p>
</div>

View file

@ -18,11 +18,17 @@ module Haml::Helpers
end
end
class DummyController
def self.controller_path
''
end
end
class TemplateTest < Test::Unit::TestCase
TEMPLATE_PATH = File.join(File.dirname(__FILE__), "templates")
TEMPLATES = %w{ very_basic standard helpers
whitespace_handling original_engine list helpful
silent_script tag_parsing just_stuff partials
silent_script tag_parsing just_stuff partials partial_layout
filters nuke_outer_whitespace nuke_inner_whitespace }
def setup
@ -49,6 +55,8 @@ class TemplateTest < Test::Unit::TestCase
# filters template uses :sass
Sass::Plugin.options.update(:line_comments => true, :style => :compact)
@base.controller = DummyController.new
end
def render(text)

View file

@ -0,0 +1,3 @@
.partial-layout
%h2 This is inside a partial layout
= yield

View file

@ -0,0 +1,3 @@
%h1 Partial layout used with for block:
- render :layout => 'layout_for_partial.haml' do
%p Some content within a layout