Skip to content
Snippets Groups Projects
Commit 93be50bc authored by capotej's avatar capotej
Browse files

failing test for package rewind bug

parent 7323282e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -26,6 +26,11 @@ class PackagecloudServer < WEBrick::HTTPServlet::AbstractServlet
response.status = 201
response['Content-Type'] = "text/plain"
response.body = "{}"
### Cheap hack to avoid parsing a multipart request here,
### instead we just check that the body isn't impossibly small
if (request.body.size < 1000)
raise "Request is too small! #{request.body.size}"
end
$request, $response = request, response
end
 
Loading
Loading
@@ -55,7 +60,7 @@ class PackagecloudServer < WEBrick::HTTPServlet::AbstractServlet
if request.request_method == "GET"
json_response(request, response, REPOS)
else
created_response(request, response)
plain_response(request, response, "{}")
end
when "/api/v1/repos/joedamato/test_repo.json"
json_response(request, response, REPO)
Loading
Loading
Loading
Loading
@@ -57,6 +57,17 @@ describe Packagecloud do
expect($request.content_length > size).to be_truthy
end
 
it "POST debian package /api/v1/repos/joedamato/test_repo/packages.json twice" do
path = "spec/fixtures/libampsharp2.0-cil_2.0.4-1_all.deb"
package = Package.new(:file => path)
@client.put_package("test_repo", package, 22)
result = @client.put_package("test_repo", package, 21)
expect(result.succeeded).to be_truthy
end
it "POST gem package /api/v1/repos/joedamato/test_repo/packages.json" do
path = "spec/fixtures/chewbacca-1.0.0.gem"
size = File.size(path)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment