diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2018-06-23 18:38:56 -0700 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2018-06-23 18:38:56 -0700 |
commit | cc7608f7a9eb1e7c4f4cd490c8762c8a391d7a6a (patch) | |
tree | 0bb3c2ef947b9d8186419ded159a77abde891511 /chef-config/spec | |
parent | dce10ada511109e9b62093dc5101e1303a40f660 (diff) | |
download | chef-cc7608f7a9eb1e7c4f4cd490c8762c8a391d7a6a.tar.gz |
Make the default validation client name more likely to be correct.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'chef-config/spec')
-rw-r--r-- | chef-config/spec/unit/config_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb index 71ea158840..7e32a1e742 100644 --- a/chef-config/spec/unit/config_spec.rb +++ b/chef-config/spec/unit/config_spec.rb @@ -1191,4 +1191,22 @@ RSpec.describe ChefConfig::Config do end + describe "validation_client_name" do + context "with a normal server URL" do + before { ChefConfig::Config[:chef_server_url] = "https://chef.example/organizations/myorg" } + + it "sets the validation client to myorg-validator" do + expect(ChefConfig::Config[:validation_client_name]).to eq "myorg-validator" + end + end + + context "with an unusual server URL" do + before { ChefConfig::Config[:chef_server_url] = "https://chef.example/myorg" } + + it "sets the validation client to chef-validator" do + expect(ChefConfig::Config[:validation_client_name]).to eq "chef-validator" + end + end + end + end |