|
|
@ -58,13 +58,13 @@ func createAttachment(t *testing.T, session *TestSession, repoURL, filename stri |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestCreateAnonymousAttachment(t *testing.T) { |
|
|
|
func TestCreateAnonymousAttachment(t *testing.T) { |
|
|
|
prepareTestEnv(t) |
|
|
|
defer prepareTestEnv(t)() |
|
|
|
session := emptyTestSession(t) |
|
|
|
session := emptyTestSession(t) |
|
|
|
createAttachment(t, session, "user2/repo1", "image.png", generateImg(), http.StatusFound) |
|
|
|
createAttachment(t, session, "user2/repo1", "image.png", generateImg(), http.StatusFound) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestCreateIssueAttachment(t *testing.T) { |
|
|
|
func TestCreateIssueAttachment(t *testing.T) { |
|
|
|
prepareTestEnv(t) |
|
|
|
defer prepareTestEnv(t)() |
|
|
|
const repoURL = "user2/repo1" |
|
|
|
const repoURL = "user2/repo1" |
|
|
|
session := loginUser(t, "user2") |
|
|
|
session := loginUser(t, "user2") |
|
|
|
uuid := createAttachment(t, session, repoURL, "image.png", generateImg(), http.StatusOK) |
|
|
|
uuid := createAttachment(t, session, repoURL, "image.png", generateImg(), http.StatusOK) |
|
|
@ -93,7 +93,7 @@ func TestCreateIssueAttachment(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestGetAttachment(t *testing.T) { |
|
|
|
func TestGetAttachment(t *testing.T) { |
|
|
|
prepareTestEnv(t) |
|
|
|
defer prepareTestEnv(t)() |
|
|
|
adminSession := loginUser(t, "user1") |
|
|
|
adminSession := loginUser(t, "user1") |
|
|
|
user2Session := loginUser(t, "user2") |
|
|
|
user2Session := loginUser(t, "user2") |
|
|
|
user8Session := loginUser(t, "user8") |
|
|
|
user8Session := loginUser(t, "user8") |
|
|
|