summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authornimisha <nimisha.sharad@msystechnologies.com>2017-12-18 17:44:15 +0530
committernimisha <nimisha.sharad@msystechnologies.com>2018-01-24 15:00:37 +0530
commitcc9766bd0a98b733eef3e9d40f3eac85a25f7e93 (patch)
tree5430925a36cbf05ed7949439a1e5686beeb1ea01 /spec
parent9382e77576921af4dd22de00bf5537e55ed60ac1 (diff)
downloadchef-cc9766bd0a98b733eef3e9d40f3eac85a25f7e93.tar.gz
Brought back Chef::Win32::Security functional test for running as a non admin user
Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/win32/security_spec.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/spec/functional/win32/security_spec.rb b/spec/functional/win32/security_spec.rb
index f3faf24c52..1caa775481 100644
--- a/spec/functional/win32/security_spec.rb
+++ b/spec/functional/win32/security_spec.rb
@@ -42,7 +42,6 @@ describe "Chef::Win32::Security", :windows_only do
before do
allow_any_instance_of(Chef::Mixin::UserContext).to receive(:node).and_return({ "platform_family" => "windows" })
allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false)
- allow(Chef::ReservedNames::Win32::Security).to receive(:OpenProcessToken).and_return(true)
add_user = Mixlib::ShellOut.new("net user #{user} #{password} /ADD")
add_user.run_command
add_user.error!
@@ -54,7 +53,7 @@ describe "Chef::Win32::Security", :windows_only do
delete_user.error!
end
it "has_admin_privileges? returns false" do
- has_admin_privileges = with_user_context(user, password, domain) do
+ has_admin_privileges = with_user_context(user, password, domain, :local) do
Chef::ReservedNames::Win32::Security.has_admin_privileges?
end
expect(has_admin_privileges).to eq(false)