summaryrefslogtreecommitdiff
path: root/spec/unit/api_client_spec.rb
diff options
context:
space:
mode:
authortylercloke <tylercloke@gmail.com>2015-06-02 11:15:32 -0700
committertylercloke <tylercloke@gmail.com>2015-06-05 10:38:49 -0700
commita929c389252d5da4c3ddc2f0cce10e43e6dc19ab (patch)
treef91aa4d30ddf13c040d507e5baa68dc5c9f751c2 /spec/unit/api_client_spec.rb
parentfb73d4ae3a0c20a3c0dfa5a85b652b8f0cba5a32 (diff)
downloadchef-a929c389252d5da4c3ddc2f0cce10e43e6dc19ab.tar.gz
Reregister V0 support for Chef::Client.
Diffstat (limited to 'spec/unit/api_client_spec.rb')
-rw-r--r--spec/unit/api_client_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb
index b903c0e3c7..e1ffa9252a 100644
--- a/spec/unit/api_client_spec.rb
+++ b/spec/unit/api_client_spec.rb
@@ -490,5 +490,24 @@ describe Chef::ApiClient do
end # when a valid client is defined
end # update
+ # DEPRECATION
+ # This can be removed after API V0 support is gone
+ describe "reregister" do
+ context "when server API V0 is valid on the Chef Server receiving the request" do
+ it "creates a new object via the API" do
+ expect(@client.chef_rest_v0).to receive(:put).with("clients/#{@client.name}", payload.merge({:private_key => true})).and_return({})
+ @client.reregister
+ end
+ end # when server API V0 is valid on the Chef Server receiving the request
+
+ context "when server API V0 is not supported by the Chef Server" do
+ # from spec/support/shared/unit/api_versioning.rb
+ it_should_behave_like "user and client reregister" do
+ let(:object) { @client }
+ let(:rest_v0) { @client.chef_rest_v0 }
+ end
+ end # when server API V0 is not supported by the Chef Server
+ end # reregister
+
end
end