From 11a687a19b26f93713226cd205cdc700b340203d Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Mon, 25 Jan 2016 13:50:26 -0800 Subject: Return 410 on /controls so we stop skipping that pedant spec. --- lib/chef_zero/endpoints/controls_endpoint.rb | 15 +++++++++++++++ lib/chef_zero/server.rb | 2 ++ spec/run_oc_pedant.rb | 1 - 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lib/chef_zero/endpoints/controls_endpoint.rb diff --git a/lib/chef_zero/endpoints/controls_endpoint.rb b/lib/chef_zero/endpoints/controls_endpoint.rb new file mode 100644 index 0000000..5790d7f --- /dev/null +++ b/lib/chef_zero/endpoints/controls_endpoint.rb @@ -0,0 +1,15 @@ +module ChefZero + module Endpoints + # /organizations/ORG/controls + class ControlsEndpoint < RestBase + # ours is not to wonder why; ours is but to make the pedant specs pass. + def get(request) + error(410, "Server says 410, chef-zero says 410.") + end + + def post(request) + error(410, "Server says 410, chef-zero says 410.") + end + end + end +end diff --git a/lib/chef_zero/server.rb b/lib/chef_zero/server.rb index df97c88..d6f27c4 100644 --- a/lib/chef_zero/server.rb +++ b/lib/chef_zero/server.rb @@ -50,6 +50,7 @@ require 'chef_zero/endpoints/cookbook_artifact_endpoint' require 'chef_zero/endpoints/cookbook_artifact_identifier_endpoint' require 'chef_zero/endpoints/containers_endpoint' require 'chef_zero/endpoints/container_endpoint' +require 'chef_zero/endpoints/controls_endpoint' require 'chef_zero/endpoints/dummy_endpoint' require 'chef_zero/endpoints/data_bags_endpoint' require 'chef_zero/endpoints/data_bag_endpoint' @@ -563,6 +564,7 @@ module ChefZero [ "/dummy", DummyEndpoint.new(self) ], [ "/organizations/*/clients", ActorsEndpoint.new(self) ], [ "/organizations/*/clients/*", ActorEndpoint.new(self) ], + [ "/organizations/*/controls", ControlsEndpoint.new(self) ], [ "/organizations/*/cookbooks", CookbooksEndpoint.new(self) ], [ "/organizations/*/cookbooks/*", CookbookEndpoint.new(self) ], [ "/organizations/*/cookbooks/*/*", CookbookVersionEndpoint.new(self) ], diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index a064618..cb24122 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -101,7 +101,6 @@ begin # # ...but we're not there yet '--skip-keys', - '--skip-controls', '--skip-acl', # Chef Zero does not intend to support validation the way erchef does. -- cgit v1.2.1