8000 tests · ezhangle/arangodb@8997582 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8997582

Browse files
committed
tests
1 parent 7d4d1b3 commit 8997582

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

UnitTests/HttpInterface/api-admin-spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
# check response code
144144
doc.code.should eq(200)
145145
# check whether HTML result contains expected title
146-
doc.response.body.should include("<!-- ArangoDB web interface -->")
146+
doc.response.body.should include("ArangoDB Web Interface")
147147
end
148148

149149
it "checks whether the admin interface is available at /" do

UnitTests/HttpInterface/api-http-spec.rb

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
################################################################################
1313
## checking HTTP HEAD responses
1414
################################################################################
15-
1615
context "head requests:" do
1716
it "checks whether HEAD returns a body on 2xx" do
1817
cmd = "/_api/version"
@@ -144,6 +143,41 @@
144143
end
145144
end
146145

146+
################################################################################
147+
## checking GZIP requests
148+
################################################################################
149+
150+
context "gzip requests" do
151+
before do
152+
@headers = "DELETE, GET, HEAD, PATCH, POST, PUT"
153+
end
154+
155+
it "checks handling of an request, with gzip support" do
156+
require 'uri'
157+
require 'net/http'
158+
uri = URI.parse("http://127.0.0.1/_db/_system/_admin/aardvark/standalone.html")
159+
uri.port = 8529
160+
http = Net::HTTP.new(uri.host, uri.port)
161+
162+
request = Net::HTTP::Get.new(uri.request_uri)
163+
request["Accept-Encoding"] = "gzip"
164+
response = http.request(request)
165+
166+
# check content encoding
167+
response['content-encoding'].should eq('gzip')
168+
end
169+
170+
it "checks handling of an request, without gzip support" do
171+
cmd = "/_admin/aardvark/standalone.html"
172+
doc = ArangoDB.log_get("admin-interface-get", cmd, :headers => { "Accept-Encoding" => "" }, :format => :plain)
173+
174+
# check response code
175+
doc.code.should eq(200)
176+
# check content encoding
177+
doc.headers['Content-Encoding'].should be nil
178+
end
179+
end
180+
147181
################################################################################
148182
## checking CORS requests
149183
################################################################################

0 commit comments

Comments
 (0)
0