summaryrefslogtreecommitdiff
path: root/chef-config/spec/unit/config_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'chef-config/spec/unit/config_spec.rb')
-rw-r--r--chef-config/spec/unit/config_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb
index dbde3d3160..e92eacf118 100644
--- a/chef-config/spec/unit/config_spec.rb
+++ b/chef-config/spec/unit/config_spec.rb
@@ -802,6 +802,29 @@ RSpec.describe ChefConfig::Config do
end
+ describe "insights integration" do
+
+ it "marks insights disabled by default" do
+ expect(ChefConfig::Config.insights_url).to be_nil
+ expect(ChefConfig::Config.insights_enabled).to eq(false)
+ end
+
+ it "errors on invalid insights_url" do
+ expect { ChefConfig::Config.insights_url = "127.0.0.1" }.to raise_error(ChefConfig::ConfigurationError)
+ end
+
+ context "when insights_url is set with valid url" do
+ before do
+ ChefConfig::Config.insights_url = "https://insights.example.com"
+ end
+
+ it "marks insights as enabled" do
+ expect(ChefConfig::Config.insights_url).to eq("https://insights.example.com")
+ expect(ChefConfig::Config.insights_enabled).to eq(true)
+ end
+ end
+ end
+
describe "Treating deprecation warnings as errors" do
context "when using our default RSpec configuration" do