forked from forgejo/forgejo
Optimize and unit test Issue_ReplaceLabels (#1080)
This commit is contained in:
parent
a201977590
commit
cf80e19157
3 changed files with 57 additions and 30 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue