From 181c8d9c99f36439f70258dcc17ff8c0c76ad416 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Wed, 8 Feb 2017 01:29:21 -0500 Subject: Fix consistency check (#866) --- models/issue_label_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'models/issue_label_test.go') 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{}) } -- cgit v1.2.3