You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
821 B
29 lines
821 B
8 years ago
|
// 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.
|
||
|
|
||
2 years ago
|
package integration
|
||
8 years ago
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"testing"
|
||
|
|
||
2 years ago
|
"code.gitea.io/gitea/tests"
|
||
8 years ago
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestPullCompare(t *testing.T) {
|
||
2 years ago
|
defer tests.PrepareTestEnv(t)()
|
||
8 years ago
|
|
||
8 years ago
|
session := loginUser(t, "user2")
|
||
8 years ago
|
req := NewRequest(t, "GET", "/user2/repo1/pulls")
|
||
7 years ago
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
||
8 years ago
|
htmlDoc := NewHTMLParser(t, resp.Body)
|
||
7 years ago
|
link, exists := htmlDoc.doc.Find(".ui.three.column.grid").Find(".ui.green.button").Attr("href")
|
||
8 years ago
|
assert.True(t, exists, "The template has changed")
|
||
|
|
||
8 years ago
|
req = NewRequest(t, "GET", link)
|
||
7 years ago
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||
7 years ago
|
assert.EqualValues(t, http.StatusOK, resp.Code)
|
||
8 years ago
|
}
|