From 43d628d4f0e3954fcd8be9a1371c6dc8674ea1ae Mon Sep 17 00:00:00 2001 From: Matthew Haughton Date: Thu, 21 Nov 2013 23:22:01 -0500 Subject: [PATCH] fix auth_basic/auth_basic_user_file variable detection --- spec/defines/resource_location_spec.rb | 25 ++++++++++---------- templates/vhost/vhost_location_directory.erb | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/spec/defines/resource_location_spec.rb b/spec/defines/resource_location_spec.rb index e420007d4..8d6e3470d 100644 --- a/spec/defines/resource_location_spec.rb +++ b/spec/defines/resource_location_spec.rb @@ -338,19 +338,18 @@ :value => ['name1','name2'], :match => ' index name1 name2;', }, - #TODO: fix template - #{ - # :title => 'should set auth_basic', - # :attr => 'auth_basic', - # :value => 'value', - # :match => ' auth_basic "value";', - #}, - #{ - # :title => 'should set auth_basic_user_file', - # :attr => 'auth_basic_user_file', - # :value => 'value', - # :match => ' auth_basic_user_file value;', - #}, + { + :title => 'should set auth_basic', + :attr => 'auth_basic', + :value => 'value', + :match => ' auth_basic "value";', + }, + { + :title => 'should set auth_basic_user_file', + :attr => 'auth_basic_user_file', + :value => 'value', + :match => ' auth_basic_user_file value;', + }, { :title => 'should contain ordered appended directives', :attr => 'location_cfg_append', diff --git a/templates/vhost/vhost_location_directory.erb b/templates/vhost/vhost_location_directory.erb index a2731fa93..be43f66b2 100644 --- a/templates/vhost/vhost_location_directory.erb +++ b/templates/vhost/vhost_location_directory.erb @@ -17,10 +17,10 @@ <% if @index_files -%> index <% @index_files.each do |i| %> <%= i %><% end %>; <% end -%> -<% if defined? auth_basic -%> +<% if defined? @auth_basic -%> auth_basic "<%= @auth_basic %>"; <% end -%> -<% if defined? auth_basic_user_file -%> +<% if defined? @auth_basic_user_file -%> auth_basic_user_file <%= @auth_basic_user_file %>; <% end -%> <% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>