Adding API tests that verifies recently changed code bevaviour

This commit is contained in:
Denis Makogon
2017-09-21 02:25:36 +03:00
parent 830c86efe7
commit f4699ea0ba
3 changed files with 20 additions and 1 deletions

View File

@@ -223,11 +223,13 @@ func (ds *sqlStore) UpdateApp(ctx context.Context, newapp *models.App) (*models.
func (ds *sqlStore) RemoveApp(ctx context.Context, appName string) error {
return ds.Tx(func(tx *sqlx.Tx) error {
res, err := tx.ExecContext(ctx, tx.Rebind(`DELETE FROM apps WHERE name=?`), appName)
if err != nil {
return err
}
n, err := res.RowsAffected()
if err != nil {
return err
}
if n == 0 {
return models.ErrAppsNotFound
}