summaryrefslogtreecommitdiff
path: root/spec/unit/user_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/user_spec.rb
parentfb73d4ae3a0c20a3c0dfa5a85b652b8f0cba5a32 (diff)
downloadchef-a929c389252d5da4c3ddc2f0cce10e43e6dc19ab.tar.gz
Reregister V0 support for Chef::Client.
Diffstat (limited to 'spec/unit/user_spec.rb')
-rw-r--r--spec/unit/user_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/unit/user_spec.rb b/spec/unit/user_spec.rb
index d9872ef5a8..15d9591712 100644
--- a/spec/unit/user_spec.rb
+++ b/spec/unit/user_spec.rb
@@ -504,6 +504,35 @@ describe Chef::User do
end # create
+ # DEPRECATION
+ # This can be removed after API V0 support is gone
+ describe "reregister" do
+ let(:payload) {
+ {
+ "username" => "some_username",
+ }
+ }
+
+ before do
+ @user.username "some_username"
+ end
+
+ 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(@user.chef_root_rest_v0).to receive(:put).with("users/#{@user.username}", payload.merge({"private_key" => true})).and_return({})
+ @user.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) { @user }
+ let(:rest_v0) { @user.chef_root_rest_v0 }
+ end
+ end # when server API V0 is not supported by the Chef Server
+ end # reregister
+
end # Versioned API Interactions
describe "API Interactions" do