summaryrefslogtreecommitdiffstats
path: root/models/issue_label_test.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-02-08 01:29:21 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-08 14:29:21 +0800
commit181c8d9c99f36439f70258dcc17ff8c0c76ad416 (patch)
treed31387070f79b47176c24f70fbfbaab3ccd55c29 /models/issue_label_test.go
parentd2329e1c261bb235bfa32692710434936b98533b (diff)
downloadgitea-181c8d9c99f36439f70258dcc17ff8c0c76ad416.tar.gz
gitea-181c8d9c99f36439f70258dcc17ff8c0c76ad416.zip
Fix consistency check (#866)
Diffstat (limited to 'models/issue_label_test.go')
-rw-r--r--models/issue_label_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/issue_label_test.go b/models/issue_label_test.go
index a1cdb8c9b6..2ef396668a 100644
--- a/models/issue_label_test.go
+++ b/models/issue_label_test.go
@@ -54,6 +54,7 @@ func TestNewLabels(t *testing.T) {
for _, label := range labels {
AssertExistsAndLoadBean(t, label)
}
+ CheckConsistencyFor(t, &Label{}, &Repository{})
}
func TestGetLabelByID(t *testing.T) {
@@ -138,6 +139,7 @@ func TestUpdateLabel(t *testing.T) {
assert.NoError(t, UpdateLabel(label))
newLabel := AssertExistsAndLoadBean(t, &Label{ID: 1}).(*Label)
assert.Equal(t, *label, *newLabel)
+ CheckConsistencyFor(t, &Label{}, &Repository{})
}
func TestDeleteLabel(t *testing.T) {
@@ -150,6 +152,7 @@ func TestDeleteLabel(t *testing.T) {
AssertNotExistsBean(t, &Label{ID: label.ID, RepoID: label.RepoID})
assert.NoError(t, DeleteLabel(NonexistentID, NonexistentID))
+ CheckConsistencyFor(t, &Label{}, &Repository{})
}
func TestHasIssueLabel(t *testing.T) {
@@ -180,6 +183,7 @@ func TestNewIssueLabel(t *testing.T) {
// re-add existing IssueLabel
assert.NoError(t, NewIssueLabel(issue, label, doer))
+ CheckConsistencyFor(t, &Issue{}, &Label{})
}
func TestNewIssueLabels(t *testing.T) {
@@ -208,6 +212,8 @@ func TestNewIssueLabels(t *testing.T) {
// corner case: test empty slice
assert.NoError(t, NewIssueLabels(issue, []*Label{}, doer))
+
+ CheckConsistencyFor(t, &Issue{}, &Label{})
}
func TestDeleteIssueLabel(t *testing.T) {
@@ -241,4 +247,6 @@ func TestDeleteIssueLabel(t *testing.T) {
testSuccess(1, 1, 2)
testSuccess(2, 5, 2)
testSuccess(1, 1, 2) // delete non-existent IssueLabel
+
+ CheckConsistencyFor(t, &Issue{}, &Label{})
}