2017-05-31 20:17:42 +05:30
|
|
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
2022-11-27 23:50:29 +05:30
|
|
|
// SPDX-License-Identifier: MIT
|
2017-05-31 20:17:42 +05:30
|
|
|
|
2022-09-03 00:48:23 +05:30
|
|
|
package integration
|
2017-05-31 20:17:42 +05:30
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
|
|
|
|
2022-09-03 00:48:23 +05:30
|
|
|
"code.gitea.io/gitea/tests"
|
2022-09-05 11:34:18 +05:30
|
|
|
|
2017-05-31 20:17:42 +05:30
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestPullCompare(t *testing.T) {
|
2022-09-03 00:48:23 +05:30
|
|
|
defer tests.PrepareTestEnv(t)()
|
2017-05-31 20:17:42 +05:30
|
|
|
|
2017-06-17 10:19:45 +05:30
|
|
|
session := loginUser(t, "user2")
|
2017-06-10 06:11:36 +05:30
|
|
|
req := NewRequest(t, "GET", "/user2/repo1/pulls")
|
2017-07-08 01:06:47 +05:30
|
|
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
2017-06-17 21:59:59 +05:30
|
|
|
htmlDoc := NewHTMLParser(t, resp.Body)
|
2017-12-31 06:17:52 +05:30
|
|
|
link, exists := htmlDoc.doc.Find(".ui.three.column.grid").Find(".ui.green.button").Attr("href")
|
2017-05-31 20:17:42 +05:30
|
|
|
assert.True(t, exists, "The template has changed")
|
|
|
|
|
2017-06-10 06:11:36 +05:30
|
|
|
req = NewRequest(t, "GET", link)
|
2017-07-08 01:06:47 +05:30
|
|
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
2017-12-04 04:16:01 +05:30
|
|
|
assert.EqualValues(t, http.StatusOK, resp.Code)
|
2017-05-31 20:17:42 +05:30
|
|
|
}
|