summaryrefslogtreecommitdiff
path: root/spec/server_spec.rb
diff options
context:
space:
mode:
authorPhil Dibowitz <phild@fb.com>2015-02-05 11:05:34 -0800
committerPhil Dibowitz <phild@fb.com>2015-03-26 12:35:27 -0700
commit1b2a6e5f107254cce8200a4750035b30265ae0c8 (patch)
tree31329630f047fde21573f3b761c8335a705b8849 /spec/server_spec.rb
parent986f72c3b9636372873b0ad1031827b454f5e796 (diff)
downloadchef-zero-1b2a6e5f107254cce8200a4750035b30265ae0c8.tar.gz
Support /version; fix some global URIs
Diffstat (limited to 'spec/server_spec.rb')
-rw-r--r--spec/server_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/server_spec.rb b/spec/server_spec.rb
index d5da281..558ef35 100644
--- a/spec/server_spec.rb
+++ b/spec/server_spec.rb
@@ -33,6 +33,12 @@ describe ChefZero::Server do
httpcall.get('/nodes', 'Accept' => accepts)
end
+ def get_version
+ uri = URI(@server.url)
+ httpcall = Net::HTTP.new(uri.host, uri.port)
+ httpcall.get('/version', 'Accept' => 'text/plain, application/json')
+ end
+
it 'accepts requests with no accept header' do
request = Net::HTTP::Get.new('/nodes')
request.delete('Accept')
@@ -77,6 +83,9 @@ describe ChefZero::Server do
expect(get_nodes('a/b;a=b;c=d, application/json;a=b, application/xml;a=b').code).to eq '200'
end
+ it 'accepts /version' do
+ expect(get_version.body.start_with?('chef-zero')).to be true
+ end
end
end
end