Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add raw blob endpoint to get objects by SHA ID #5334

Merged
merged 7 commits into from
Nov 18, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Added integration test for /repo/u/r/raw/blob
  • Loading branch information
Berengar W. Lehr authored and Berengar W. Lehr committed Nov 17, 2018
commit 01a88c0571011c136e9e793317235d5ed1c53f14
24 changes: 24 additions & 0 deletions integrations/download_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2017 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package integrations

import (
"net/http"
"testing"

"github.com/stretchr/testify/assert"
)

func TestDownloadByID(t *testing.T) {
prepareTestEnv(t)

session := loginUser(t, "user2")

// Request raw blob
req := NewRequest(t, "GET", "/user2/repo1/raw/blob/4b4851ad51df6a7d9f25c979345979eaeb5b349f")
resp := session.MakeRequest(t, req, http.StatusOK)

assert.Equal(t, "# repo1\n\nDescription for repo1", resp.Body.String())
}