summaryrefslogtreecommitdiff
path: root/spec/unit/compliance
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-02-12 13:40:19 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2021-02-12 13:40:19 -0800
commit817f3dbb5f734362cf61a395c88d3007705c3e82 (patch)
treefecf8afa99776494410f6f40c55a5f3da81d48aa /spec/unit/compliance
parent4cfb8455fcc4ffcb452c43666b0f02c140d94d82 (diff)
downloadchef-817f3dbb5f734362cf61a395c88d3007705c3e82.tar.gz
Fix automate compliance fetcher for profiles with at signslcg/fix-automate-usernames
This is largely copypasta directly out of the audit cookbook. I've preserved the original backcompat in the cookbook because it seems more important for this code to be correct than to try to mess around deprecating code that isn't hurting anything. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/compliance')
-rw-r--r--spec/unit/compliance/fetcher/automate_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/compliance/fetcher/automate_spec.rb b/spec/unit/compliance/fetcher/automate_spec.rb
index bc2125aaa7..f3554b8b0f 100644
--- a/spec/unit/compliance/fetcher/automate_spec.rb
+++ b/spec/unit/compliance/fetcher/automate_spec.rb
@@ -21,6 +21,14 @@ describe Chef::Compliance::Fetcher::Automate do
expect(res.target).to eq(expected)
end
+ it "should resolve a compliance URL with a @ in the namespace" do
+ res = Chef::Compliance::Fetcher::Automate.resolve("compliance://name@space/profile_name")
+
+ expect(res).to be_kind_of(Chef::Compliance::Fetcher::Automate)
+ expected = "https://automate.test/compliance/profiles/name@space/profile_name/tar"
+ expect(res.target).to eq(expected)
+ end
+
it "raises an exception with no data collector token" do
Chef::Config[:data_collector].delete(:token)