diff options
author | tylercloke <tylercloke@gmail.com> | 2015-07-02 11:52:23 -0700 |
---|---|---|
committer | tylercloke <tylercloke@gmail.com> | 2015-07-06 14:36:03 -0700 |
commit | 89c7984a86778c23d23e2380824af6f843d39c87 (patch) | |
tree | c34948ed3962d543be06a2cf70aa45a1fc7e913e | |
parent | dcf21598f2fec37521ca846e750c58bc34e410fa (diff) | |
download | chef-89c7984a86778c23d23e2380824af6f843d39c87.tar.gz |
Fixed old ApiClient tests.
-rw-r--r-- | spec/unit/api_client_spec.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb index 860eeacb4f..a0e399b470 100644 --- a/spec/unit/api_client_spec.rb +++ b/spec/unit/api_client_spec.rb @@ -223,8 +223,8 @@ describe Chef::ApiClient do "validator" => true, "json_class" => "Chef::ApiClient" } - @http_client = double("Chef::REST mock") - allow(Chef::REST).to receive(:new).and_return(@http_client) + @http_client = double("Chef::ServerAPI mock") + allow(Chef::ServerAPI).to receive(:new).and_return(@http_client) expect(@http_client).to receive(:get).with("clients/black").and_return(client) @client = Chef::ApiClient.load(client['name']) end @@ -270,18 +270,13 @@ describe Chef::ApiClient do File.open(Chef::Config[:client_key], "r") {|f| f.read.chomp } end - it "has an HTTP client configured with default credentials" do - expect(@client.http_api).to be_a_kind_of(Chef::REST) - expect(@client.http_api.client_name).to eq("silent-bob") - expect(@client.http_api.signing_key.to_s).to eq(private_key_data) - end end describe "when requesting a new key" do before do @http_client = double("Chef::REST mock") - allow(Chef::REST).to receive(:new).and_return(@http_client) + allow(Chef::ServerAPI).to receive(:new).and_return(@http_client) end context "and the client does not exist on the server" do |