From 4eb1b589f1d6c216be5788c501c4328a4967ba4b Mon Sep 17 00:00:00 2001 From: Andrea Campi Date: Sun, 18 Nov 2012 23:44:00 +0100 Subject: [CHEF-3249] Fix nested partials; add a test for that. --- spec/unit/mixin/template_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/unit/mixin/template_spec.rb') diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb index 4b8bcb219f..f5e5181a62 100644 --- a/spec/unit/mixin/template_spec.rb +++ b/spec/unit/mixin/template_spec.rb @@ -153,6 +153,14 @@ describe Chef::Mixin::Template, "render_template" do tmp.open.read.should == "before {super secret is } after" end end + + it "should render nested partials" do + path = File.expand_path(File.join(CHEF_SPEC_DATA, "partial_one.erb")) + + @provider.render_template("before {<%= render '#{path}', :local => true %>} after", @template_context) do |tmp| + tmp.open.read.should == "before {partial one We could be diving for pearls!\n calling home\n} after" + end + end end describe "when an exception is raised in the template" do -- cgit v1.2.1