1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-08 03:27:19 +00:00

Optimize and unit test Issue_ReplaceLabels (#1080)

This commit is contained in:
Ethan Koenig
2017-02-27 20:35:55 -05:00
committed by Lunny Xiao
parent a201977590
commit cf80e19157
3 changed files with 57 additions and 30 deletions

View File

@ -107,8 +107,9 @@ func AssertSuccessfulInsert(t *testing.T, beans ...interface{}) {
assert.NoError(t, err)
}
// AssertSuccessfulUpdate assert that bean is successfully updated
func AssertSuccessfulUpdate(t *testing.T, bean interface{}, conditions ...interface{}) {
_, err := x.Update(bean, conditions...)
// AssertCount assert the count of a bean
func AssertCount(t *testing.T, bean interface{}, expected interface{}) {
actual, err := x.Count(bean)
assert.NoError(t, err)
assert.EqualValues(t, expected, actual)
}