summaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_repo_lfs_test.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/integrations/api_repo_lfs_test.go b/integrations/api_repo_lfs_test.go
index 7aa172064e..56a6fa81fd 100644
--- a/integrations/api_repo_lfs_test.go
+++ b/integrations/api_repo_lfs_test.go
@@ -253,6 +253,10 @@ func TestAPILFSBatch(t *testing.T) {
assert.NoError(t, err)
assert.True(t, exist)
+ repo2 := createLFSTestRepository(t, "batch2")
+ content := []byte("dummy0")
+ storeObjectInRepo(t, repo2.ID, &content)
+
meta, err := repo.GetLFSMetaObjectByOid(p.Oid)
assert.Nil(t, meta)
assert.Equal(t, models.ErrLFSObjectNotExist, err)
@@ -358,13 +362,19 @@ func TestAPILFSUpload(t *testing.T) {
assert.Nil(t, meta)
assert.Equal(t, models.ErrLFSObjectNotExist, err)
- req := newRequest(t, p, "")
+ t.Run("InvalidAccess", func(t *testing.T) {
+ req := newRequest(t, p, "invalid")
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ })
- session.MakeRequest(t, req, http.StatusOK)
+ t.Run("ValidAccess", func(t *testing.T) {
+ req := newRequest(t, p, "dummy5")
- meta, err = repo.GetLFSMetaObjectByOid(p.Oid)
- assert.NoError(t, err)
- assert.NotNil(t, meta)
+ session.MakeRequest(t, req, http.StatusOK)
+ meta, err = repo.GetLFSMetaObjectByOid(p.Oid)
+ assert.NoError(t, err)
+ assert.NotNil(t, meta)
+ })
})
t.Run("MetaAlreadyExists", func(t *testing.T) {