diff options
author | Kaushik C <kaushik.chand@gmail.com> | 2015-06-09 16:00:06 -0400 |
---|---|---|
committer | Kaushik C <kaushik.chand@gmail.com> | 2015-07-27 12:52:27 -0400 |
commit | d9820c430b686a1dedd4ab2cadd20b0cadbbb0d7 (patch) | |
tree | 2ff7eef34ce7a81720aee46026ef06b6de61fc20 /spec/unit | |
parent | ce0c2d7ac2685d4fab78a99bf8fa9838b39a5eb8 (diff) | |
download | chef-d9820c430b686a1dedd4ab2cadd20b0cadbbb0d7.tar.gz |
Fixing Issue #2513 - the broken render of nested partial templates with variables
Authors: Kaushik C <kaushik.chand@gmail.com>, Sam Dunne <sam@sam-dunne.com>
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/cookbook/syntax_check_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/mixin/template_spec.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/spec/unit/cookbook/syntax_check_spec.rb b/spec/unit/cookbook/syntax_check_spec.rb index ee4e0bed02..318c2a7e85 100644 --- a/spec/unit/cookbook/syntax_check_spec.rb +++ b/spec/unit/cookbook/syntax_check_spec.rb @@ -54,6 +54,8 @@ describe Chef::Cookbook::SyntaxCheck do basenames = %w{ helpers_via_partial_test.erb helper_test.erb openldap_stuff.conf.erb + nested_openldap_partials.erb + nested_partial.erb openldap_variable_stuff.conf.erb test.erb some_windows_line_endings.erb diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb index 6a867b5f9a..95d0eb6711 100644 --- a/spec/unit/mixin/template_spec.rb +++ b/spec/unit/mixin/template_spec.rb @@ -150,6 +150,11 @@ describe Chef::Mixin::Template, "render_template" do output == "before {super secret is candy} after" end + it "should pass the template finder to the partials" do + output = @template_context.render_template_from_string("before {<%= render 'nested_openldap_partials.erb', :variables => {:hello => 'Hello World!' } %>} after") + output == "before {Hello World!} after" + end + it "should pass variables to partials" do output = @template_context.render_template_from_string("before {<%= render 'openldap_variable_stuff.conf.erb', :variables => {:secret => 'whatever' } %>} after") expect(output).to eq("before {super secret is whatever} after") @@ -266,4 +271,3 @@ describe Chef::Mixin::Template, "render_template" do end end end - |