summaryrefslogtreecommitdiff
path: root/spec/unit/knife_spec.rb
diff options
context:
space:
mode:
authortylercloke <tylercloke@gmail.com>2015-04-30 15:06:17 -0700
committertylercloke <tylercloke@gmail.com>2015-05-04 13:18:30 -0700
commitddf2135f147eca68490829dd96c65690c27f8d04 (patch)
tree50d01383e922c208625cb5ffa8c47855ccad71c0 /spec/unit/knife_spec.rb
parentc6c7329ff54851390e0e84d0b681ee8396b3f34c (diff)
downloadchef-ddf2135f147eca68490829dd96c65690c27f8d04.tar.gz
Implemented X-Ops-Server-API-Version in Chef requests.
This takes advantage of Chef::HTTP::Authenticator.handle_request. After the authentication_headers have been merged, it adds: {'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::SERVER_API_VERSION} Chef::HTTP::Authenticator::SERVER_API_VERSION should corrospond to the max version of the server the client is compatible with. We are starting at "0". I also removed outer level lets :base_header and :req_with_body_headers from rest_spec.rb as they were never used anywhere. Another :base_header was defined in a tighter part of the spec and was only used in that scope, and :req_with_body_headers was never used anywhere.
Diffstat (limited to 'spec/unit/knife_spec.rb')
-rw-r--r--spec/unit/knife_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index b748232081..cb7d5e0b9e 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -130,7 +130,8 @@ describe Chef::Knife do
"Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
'X-Chef-Version' => Chef::VERSION,
"Host"=>"api.opscode.piab",
- "X-REMOTE-REQUEST-ID"=>request_id}}
+ "X-REMOTE-REQUEST-ID"=>request_id,
+ 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::SERVER_API_VERSION}}
let(:request_id) {"1234"}