summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_releases_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_releases_test.go')
-rw-r--r--tests/integration/api_releases_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/integration/api_releases_test.go b/tests/integration/api_releases_test.go
index d7f2a1b8b1..aa5816ad02 100644
--- a/tests/integration/api_releases_test.go
+++ b/tests/integration/api_releases_test.go
@@ -176,6 +176,24 @@ func TestAPICreateReleaseToDefaultBranchOnExistingTag(t *testing.T) {
createNewReleaseUsingAPI(t, session, token, owner, repo, "v0.0.1", "", "v0.0.1", "test")
}
+func TestAPIGetLatestRelease(t *testing.T) {
+ defer tests.PrepareTestEnv(t)()
+
+ repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
+ owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
+
+ urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/releases/latest",
+ owner.Name, repo.Name)
+
+ req := NewRequestf(t, "GET", urlStr)
+ resp := MakeRequest(t, req, http.StatusOK)
+
+ var release *api.Release
+ DecodeJSON(t, resp, &release)
+
+ assert.Equal(t, "testing-release", release.Title)
+}
+
func TestAPIGetReleaseByTag(t *testing.T) {
defer tests.PrepareTestEnv(t)()