Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor assert statements in tests #16089

Merged
merged 4 commits into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integrations/api_admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func TestAPIEditUser(t *testing.T) {
assert.EqualValues(t, "email is not allowed to be empty string", errMap["message"].(string))

user2 := models.AssertExistsAndLoadBean(t, &models.User{LoginName: "user2"}).(*models.User)
assert.Equal(t, false, user2.IsRestricted)
assert.False(t, user2.IsRestricted)
bTrue := true
req = NewRequestWithJSON(t, "PATCH", urlStr, api.EditUserOption{
// required
Expand All @@ -206,5 +206,5 @@ func TestAPIEditUser(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusOK)
user2 = models.AssertExistsAndLoadBean(t, &models.User{LoginName: "user2"}).(*models.User)
assert.Equal(t, true, user2.IsRestricted)
assert.True(t, user2.IsRestricted)
}
26 changes: 13 additions & 13 deletions integrations/api_gpg_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,42 +78,42 @@ func TestGPGKeys(t *testing.T) {

primaryKey1 := keys[0] //Primary key 1
assert.EqualValues(t, "38EA3BCED732982C", primaryKey1.KeyID)
assert.EqualValues(t, 1, len(primaryKey1.Emails))
assert.Len(t, primaryKey1.Emails, 1)
assert.EqualValues(t, "user2@example.com", primaryKey1.Emails[0].Email)
assert.EqualValues(t, true, primaryKey1.Emails[0].Verified)
assert.True(t, primaryKey1.Emails[0].Verified)

subKey := primaryKey1.SubsKey[0] //Subkey of 38EA3BCED732982C
assert.EqualValues(t, "70D7C694D17D03AD", subKey.KeyID)
assert.EqualValues(t, 0, len(subKey.Emails))
assert.Empty(t, subKey.Emails)

primaryKey2 := keys[1] //Primary key 2
assert.EqualValues(t, "FABF39739FE1E927", primaryKey2.KeyID)
assert.EqualValues(t, 1, len(primaryKey2.Emails))
assert.Len(t, primaryKey2.Emails, 1)
assert.EqualValues(t, "user21@example.com", primaryKey2.Emails[0].Email)
assert.EqualValues(t, false, primaryKey2.Emails[0].Verified)
assert.False(t, primaryKey2.Emails[0].Verified)

var key api.GPGKey
req = NewRequest(t, "GET", "/api/v1/user/gpg_keys/"+strconv.FormatInt(primaryKey1.ID, 10)+"?token="+token) //Primary key 1
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &key)
assert.EqualValues(t, "38EA3BCED732982C", key.KeyID)
assert.EqualValues(t, 1, len(key.Emails))
assert.Len(t, key.Emails, 1)
assert.EqualValues(t, "user2@example.com", key.Emails[0].Email)
assert.EqualValues(t, true, key.Emails[0].Verified)
assert.True(t, key.Emails[0].Verified)

req = NewRequest(t, "GET", "/api/v1/user/gpg_keys/"+strconv.FormatInt(subKey.ID, 10)+"?token="+token) //Subkey of 38EA3BCED732982C
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &key)
assert.EqualValues(t, "70D7C694D17D03AD", key.KeyID)
assert.EqualValues(t, 0, len(key.Emails))
assert.Empty(t, key.Emails)

req = NewRequest(t, "GET", "/api/v1/user/gpg_keys/"+strconv.FormatInt(primaryKey2.ID, 10)+"?token="+token) //Primary key 2
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &key)
assert.EqualValues(t, "FABF39739FE1E927", key.KeyID)
assert.EqualValues(t, 1, len(key.Emails))
assert.Len(t, key.Emails, 1)
assert.EqualValues(t, "user21@example.com", key.Emails[0].Email)
assert.EqualValues(t, false, key.Emails[0].Verified)
assert.False(t, key.Emails[0].Verified)

})

Expand All @@ -124,23 +124,23 @@ func TestGPGKeys(t *testing.T) {
req := NewRequest(t, "GET", "/api/v1/repos/user2/repo16/branches/not-signed?token="+token)
resp := session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &branch)
assert.EqualValues(t, false, branch.Commit.Verification.Verified)
assert.False(t, branch.Commit.Verification.Verified)
})

t.Run("SignedWithNotValidatedEmail", func(t *testing.T) {
var branch api.Branch
req := NewRequest(t, "GET", "/api/v1/repos/user2/repo16/branches/good-sign-not-yet-validated?token="+token)
resp := session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &branch)
assert.EqualValues(t, false, branch.Commit.Verification.Verified)
assert.False(t, branch.Commit.Verification.Verified)
})

t.Run("SignedWithValidEmail", func(t *testing.T) {
var branch api.Branch
req := NewRequest(t, "GET", "/api/v1/repos/user2/repo16/branches/good-sign?token="+token)
resp := session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &branch)
assert.EqualValues(t, true, branch.Commit.Verification.Verified)
assert.True(t, branch.Commit.Verification.Verified)
})
})
}
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func TestAPICreateIssue(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusCreated)
var apiIssue api.Issue
DecodeJSON(t, resp, &apiIssue)
assert.Equal(t, apiIssue.Body, body)
assert.Equal(t, apiIssue.Title, title)
assert.Equal(t, body, apiIssue.Body)
assert.Equal(t, title, apiIssue.Title)

models.AssertExistsAndLoadBean(t, &models.Issue{
RepoID: repoBefore.ID,
Expand Down
16 changes: 8 additions & 8 deletions integrations/api_notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ func TestAPINotification(t *testing.T) {

assert.Len(t, apiNL, 3)
assert.EqualValues(t, 4, apiNL[0].ID)
assert.EqualValues(t, true, apiNL[0].Unread)
assert.EqualValues(t, false, apiNL[0].Pinned)
assert.True(t, apiNL[0].Unread)
assert.False(t, apiNL[0].Pinned)
assert.EqualValues(t, 3, apiNL[1].ID)
assert.EqualValues(t, false, apiNL[1].Unread)
assert.EqualValues(t, true, apiNL[1].Pinned)
assert.False(t, apiNL[1].Unread)
assert.True(t, apiNL[1].Pinned)
assert.EqualValues(t, 2, apiNL[2].ID)
assert.EqualValues(t, false, apiNL[2].Unread)
assert.EqualValues(t, false, apiNL[2].Pinned)
assert.False(t, apiNL[2].Unread)
assert.False(t, apiNL[2].Pinned)

// -- GET /repos/{owner}/{repo}/notifications --
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/notifications?status-types=unread&token=%s", user2.Name, repo1.Name, token))
Expand All @@ -74,8 +74,8 @@ func TestAPINotification(t *testing.T) {
DecodeJSON(t, resp, &apiN)

assert.EqualValues(t, 5, apiN.ID)
assert.EqualValues(t, false, apiN.Pinned)
assert.EqualValues(t, true, apiN.Unread)
assert.False(t, apiN.Pinned)
assert.True(t, apiN.Unread)
assert.EqualValues(t, "issue4", apiN.Subject.Title)
assert.EqualValues(t, "Issue", apiN.Subject.Type)
assert.EqualValues(t, thread5.Issue.APIURL(), apiN.Subject.URL)
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_oauth2_apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func testAPIGetOAuth2Application(t *testing.T) {
assert.EqualValues(t, existApp.ClientID, expectedApp.ClientID)
assert.Len(t, expectedApp.ClientID, 36)
assert.Empty(t, expectedApp.ClientSecret)
assert.EqualValues(t, len(expectedApp.RedirectURIs), 1)
assert.Len(t, expectedApp.RedirectURIs, 1)
assert.EqualValues(t, existApp.RedirectURIs[0], expectedApp.RedirectURIs[0])
models.AssertExistsAndLoadBean(t, &models.OAuth2Application{ID: expectedApp.ID, Name: expectedApp.Name})
}
Expand Down Expand Up @@ -156,7 +156,7 @@ func testAPIUpdateOAuth2Application(t *testing.T) {
DecodeJSON(t, resp, &app)
expectedApp := app

assert.EqualValues(t, len(expectedApp.RedirectURIs), 2)
assert.Len(t, expectedApp.RedirectURIs, 2)
assert.EqualValues(t, expectedApp.RedirectURIs[0], appBody.RedirectURIs[0])
assert.EqualValues(t, expectedApp.RedirectURIs[1], appBody.RedirectURIs[1])
models.AssertExistsAndLoadBean(t, &models.OAuth2Application{ID: expectedApp.ID, Name: expectedApp.Name})
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestAPIOrgCreate(t *testing.T) {
// user1 on this org is public
var users []*api.User
DecodeJSON(t, resp, &users)
assert.EqualValues(t, 1, len(users))
assert.Len(t, users, 1)
assert.EqualValues(t, "user1", users[0].UserName)
})
}
Expand Down
20 changes: 10 additions & 10 deletions integrations/api_pull_review_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ func TestAPIPullReview(t *testing.T) {
assert.EqualValues(t, 8, reviews[3].ID)
assert.EqualValues(t, "APPROVED", reviews[3].State)
assert.EqualValues(t, 0, reviews[3].CodeCommentsCount)
assert.EqualValues(t, true, reviews[3].Stale)
assert.EqualValues(t, false, reviews[3].Official)
assert.True(t, reviews[3].Stale)
assert.False(t, reviews[3].Official)

assert.EqualValues(t, 10, reviews[5].ID)
assert.EqualValues(t, "REQUEST_CHANGES", reviews[5].State)
assert.EqualValues(t, 1, reviews[5].CodeCommentsCount)
assert.EqualValues(t, -1, reviews[5].Reviewer.ID) // ghost user
assert.EqualValues(t, false, reviews[5].Stale)
assert.EqualValues(t, true, reviews[5].Official)
assert.False(t, reviews[5].Stale)
assert.True(t, reviews[5].Official)

// test GetPullReview
req = NewRequestf(t, http.MethodGet, "/api/v1/repos/%s/%s/pulls/%d/reviews/%d?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, reviews[3].ID, token)
Expand Down Expand Up @@ -118,14 +118,14 @@ func TestAPIPullReview(t *testing.T) {
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &review)
assert.EqualValues(t, 6, review.ID)
assert.EqualValues(t, true, review.Dismissed)
assert.True(t, review.Dismissed)

// test dismiss review
req = NewRequest(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/reviews/%d/undismissals?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, review.ID, token))
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &review)
assert.EqualValues(t, 6, review.ID)
assert.EqualValues(t, false, review.Dismissed)
assert.False(t, review.Dismissed)

// test DeletePullReview
req = NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/reviews?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, token), &api.CreatePullReviewOptions{
Expand All @@ -151,15 +151,15 @@ func TestAPIPullReview(t *testing.T) {
assert.EqualValues(t, 11, reviews[0].ID)
assert.EqualValues(t, "REQUEST_REVIEW", reviews[0].State)
assert.EqualValues(t, 0, reviews[0].CodeCommentsCount)
assert.EqualValues(t, false, reviews[0].Stale)
assert.EqualValues(t, true, reviews[0].Official)
assert.False(t, reviews[0].Stale)
assert.True(t, reviews[0].Official)
assert.EqualValues(t, "test_team", reviews[0].ReviewerTeam.Name)

assert.EqualValues(t, 12, reviews[1].ID)
assert.EqualValues(t, "REQUEST_REVIEW", reviews[1].State)
assert.EqualValues(t, 0, reviews[0].CodeCommentsCount)
assert.EqualValues(t, false, reviews[1].Stale)
assert.EqualValues(t, true, reviews[1].Official)
assert.False(t, reviews[1].Stale)
assert.True(t, reviews[1].Official)
assert.EqualValues(t, 1, reviews[1].Reviewer.ID)
}

Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestAPIReposGetTags(t *testing.T) {
var tags []*api.Tag
DecodeJSON(t, resp, &tags)

assert.EqualValues(t, 1, len(tags))
assert.Len(t, tags, 1)
assert.Equal(t, "v1.1", tags[0].Name)
assert.Equal(t, "65f1bf27bc3bf70f64657658635e66094edbcb4d", tags[0].Commit.SHA)
assert.Equal(t, setting.AppURL+"api/v1/repos/user2/repo1/git/commits/65f1bf27bc3bf70f64657658635e66094edbcb4d", tags[0].Commit.URL)
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_repo_teams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func TestAPIRepoTeams(t *testing.T) {
DecodeJSON(t, res, &teams)
if assert.Len(t, teams, 2) {
assert.EqualValues(t, "Owners", teams[0].Name)
assert.EqualValues(t, false, teams[0].CanCreateOrgRepo)
assert.False(t, teams[0].CanCreateOrgRepo)
assert.EqualValues(t, []string{"repo.code", "repo.issues", "repo.pulls", "repo.releases", "repo.wiki", "repo.ext_wiki", "repo.ext_issues"}, teams[0].Units)
assert.EqualValues(t, "owner", teams[0].Permission)

assert.EqualValues(t, "test_team", teams[1].Name)
assert.EqualValues(t, false, teams[1].CanCreateOrgRepo)
assert.False(t, teams[1].CanCreateOrgRepo)
assert.EqualValues(t, []string{"repo.issues"}, teams[1].Units)
assert.EqualValues(t, "write", teams[1].Permission)
}
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_repo_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
assert.Equal(t, 25, len(topics.TopicNames))
assert.Len(t, topics.TopicNames, 25)

// Test writing more topics than allowed
newTopics = append(newTopics, "t26")
Expand All @@ -115,7 +115,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
assert.Equal(t, 0, len(topics.TopicNames))
assert.Empty(t, topics.TopicNames)

// Test add a topic to repo with write access (requires repo admin access)
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user3.Name, repo3.Name, "topicName", token4)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestAPITeamSearch(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &results)
assert.NotEmpty(t, results.Data)
assert.Equal(t, 1, len(results.Data))
assert.Len(t, results.Data, 1)
assert.Equal(t, "test_team", results.Data[0].Name)

// no access if not organization member
Expand Down
2 changes: 1 addition & 1 deletion integrations/org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestOrgRepos(t *testing.T) {
htmlDoc := NewHTMLParser(t, resp.Body)

sel := htmlDoc.doc.Find("a.name")
assert.EqualValues(t, len(repos), len(sel.Nodes))
assert.Len(t, repos, len(sel.Nodes))
for i := 0; i < len(repos); i++ {
assert.EqualValues(t, repos[i], strings.TrimSpace(sel.Eq(i).Text()))
}
Expand Down
2 changes: 1 addition & 1 deletion integrations/repo_commits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) {
doc = NewHTMLParser(t, resp.Body)
// Check if commit status is displayed in message column
sel := doc.doc.Find("#commits-table tbody tr td.message a.commit-statuses-trigger i.commit-status")
assert.Equal(t, sel.Length(), 1)
assert.Equal(t, 1, sel.Length())
for _, class := range classes {
assert.True(t, sel.HasClass(class))
}
Expand Down
12 changes: 6 additions & 6 deletions integrations/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ func TestViewRepoWithSymlinks(t *testing.T) {
file := strings.Trim(s.Find("A").Text(), " \t\n")
return fmt.Sprintf("%s: %s", file, cls)
})
assert.Equal(t, len(items), 5)
assert.Equal(t, items[0], "a: svg octicon-file-directory")
assert.Equal(t, items[1], "link_b: svg octicon-file-submodule")
assert.Equal(t, items[2], "link_d: svg octicon-file-symlink-file")
assert.Equal(t, items[3], "link_hi: svg octicon-file-symlink-file")
assert.Equal(t, items[4], "link_link: svg octicon-file-symlink-file")
assert.Len(t, items, 5)
assert.Equal(t, "a: svg octicon-file-directory", items[0])
assert.Equal(t, "link_b: svg octicon-file-submodule", items[1])
assert.Equal(t, "link_d: svg octicon-file-symlink-file", items[2])
assert.Equal(t, "link_hi: svg octicon-file-symlink-file", items[3])
assert.Equal(t, "link_link: svg octicon-file-symlink-file", items[4])
}

// TestViewAsRepoAdmin tests PR #2167
Expand Down
6 changes: 3 additions & 3 deletions models/attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ func TestGetByCommentOrIssueID(t *testing.T) {
// count of attachments from issue ID
attachments, err := GetAttachmentsByIssueID(1)
assert.NoError(t, err)
assert.Equal(t, 1, len(attachments))
assert.Len(t, attachments, 1)

attachments, err = GetAttachmentsByCommentID(1)
assert.NoError(t, err)
assert.Equal(t, 2, len(attachments))
assert.Len(t, attachments, 2)
}

func TestDeleteAttachments(t *testing.T) {
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestGetAttachmentsByUUIDs(t *testing.T) {

attachList, err := GetAttachmentsByUUIDs(DefaultDBContext(), []string{"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17", "not-existing-uuid"})
assert.NoError(t, err)
assert.Equal(t, 2, len(attachList))
assert.Len(t, attachList, 2)
assert.Equal(t, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", attachList[0].UUID)
assert.Equal(t, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17", attachList[1].UUID)
assert.Equal(t, int64(1), attachList[0].IssueID)
Expand Down
2 changes: 1 addition & 1 deletion models/issue_stopwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestCreateOrStopIssueStopwatch(t *testing.T) {

assert.NoError(t, CreateOrStopIssueStopwatch(user3, issue1))
sw := AssertExistsAndLoadBean(t, &Stopwatch{UserID: 3, IssueID: 1}).(*Stopwatch)
assert.Equal(t, true, sw.CreatedUnix <= timeutil.TimeStampNow())
assert.LessOrEqual(t, sw.CreatedUnix, timeutil.TimeStampNow())

assert.NoError(t, CreateOrStopIssueStopwatch(user2, issue2))
AssertNotExistsBean(t, &Stopwatch{UserID: 2, IssueID: 2})
Expand Down
2 changes: 1 addition & 1 deletion models/issue_watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestGetIssueWatch(t *testing.T) {
iw, exists, err := GetIssueWatch(2, 2)
assert.True(t, exists)
assert.NoError(t, err)
assert.EqualValues(t, false, iw.IsWatching)
assert.False(t, iw.IsWatching)

_, exists, err = GetIssueWatch(3, 1)
assert.False(t, exists)
Expand Down
8 changes: 4 additions & 4 deletions models/issue_xref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestXRef_AddCrossReferences(t *testing.T) {
ref := AssertExistsAndLoadBean(t, &Comment{IssueID: itarget.ID, RefIssueID: pr.ID, RefCommentID: 0}).(*Comment)
assert.Equal(t, CommentTypePullRef, ref.Type)
assert.Equal(t, pr.RepoID, ref.RefRepoID)
assert.Equal(t, true, ref.RefIsPull)
assert.True(t, ref.RefIsPull)
assert.Equal(t, references.XRefActionCloses, ref.RefAction)

// Comment on PR to reopen issue #1
Expand All @@ -34,7 +34,7 @@ func TestXRef_AddCrossReferences(t *testing.T) {
ref = AssertExistsAndLoadBean(t, &Comment{IssueID: itarget.ID, RefIssueID: pr.ID, RefCommentID: c.ID}).(*Comment)
assert.Equal(t, CommentTypeCommentRef, ref.Type)
assert.Equal(t, pr.RepoID, ref.RefRepoID)
assert.Equal(t, true, ref.RefIsPull)
assert.True(t, ref.RefIsPull)
assert.Equal(t, references.XRefActionReopens, ref.RefAction)

// Issue mentioning issue #1
Expand All @@ -43,7 +43,7 @@ func TestXRef_AddCrossReferences(t *testing.T) {
ref = AssertExistsAndLoadBean(t, &Comment{IssueID: itarget.ID, RefIssueID: i.ID, RefCommentID: 0}).(*Comment)
assert.Equal(t, CommentTypeIssueRef, ref.Type)
assert.Equal(t, pr.RepoID, ref.RefRepoID)
assert.Equal(t, false, ref.RefIsPull)
assert.False(t, ref.RefIsPull)
assert.Equal(t, references.XRefActionNone, ref.RefAction)

// Issue #4 to test against
Expand All @@ -55,7 +55,7 @@ func TestXRef_AddCrossReferences(t *testing.T) {
ref = AssertExistsAndLoadBean(t, &Comment{IssueID: itarget.ID, RefIssueID: i.ID, RefCommentID: 0}).(*Comment)
assert.Equal(t, CommentTypeIssueRef, ref.Type)
assert.Equal(t, i.RepoID, ref.RefRepoID)
assert.Equal(t, false, ref.RefIsPull)
assert.False(t, ref.RefIsPull)
assert.Equal(t, references.XRefActionNone, ref.RefAction)

// Cross-reference to issue #4 with no permission
Expand Down
Loading