Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Commit 0149bea

Browse files
scripts/tests: add channel deletion test
1 parent 4ef27a1 commit 0149bea

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package main
2+
3+
import (
4+
"socialapi/models"
5+
"socialapi/workers/common/tests"
6+
"testing"
7+
8+
"github.com/koding/runner"
9+
. "github.com/smartystreets/goconvey/convey"
10+
)
11+
12+
// var AccountOldId = bson.NewObjectId()
13+
14+
func TestChannelDelete(t *testing.T) {
15+
tests.WithRunner(t, func(r *runner.Runner) {
16+
Convey("while creating account", t, func() {
17+
Convey("First Create User", func() {
18+
Convey("Should not error if you pass old id", func() {
19+
channel, accounts := models.CreateChannelWithParticipants()
20+
So(channel, ShouldNotBeNil)
21+
So(accounts, ShouldNotBeNil)
22+
err := models.DeleteChannelsIfGroupNotInMongo()
23+
So(err, ShouldBeNil)
24+
})
25+
})
26+
})
27+
})
28+
}
29+
30+
//
31+
// func accountCreatorWithCount(count int) error {
32+
// for i := 0; i < count; i++ {
33+
// account := models.NewAccount()
34+
// account.OldId = bson.NewObjectId().Hex()
35+
// account, err := rest.CreateAccount(account)
36+
// if err != nil {
37+
// return err
38+
// }
39+
// }
40+
// return nil
41+
// }

0 commit comments

Comments
 (0)