Skip to content

Commit

Permalink
Remove some leftover references to topups
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Oct 20, 2022
1 parent 8e457e0 commit a53d5b4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
28 changes: 0 additions & 28 deletions core/handlers/msg_created_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,6 @@ func TestMsgCreated(t *testing.T) {
assert.Equal(t, 1, count)
}

func TestNoTopup(t *testing.T) {
ctx, rt, db, _ := testsuite.Get()

defer testsuite.Reset(testsuite.ResetAll)

// no more credits
db.MustExec(`UPDATE orgs_topup SET credits = 0 WHERE org_id = $1`, testdata.Org1.ID)

tcs := []handlers.TestCase{
{
Actions: handlers.ContactActionMap{
testdata.Cathy: []flows.Action{
actions.NewSendMsg(handlers.NewActionUUID(), "No Topup", nil, nil, false),
},
},
SQLAssertions: []handlers.SQLAssertion{
{
SQL: "SELECT COUNT(*) FROM msgs_msg WHERE text='No Topup' AND contact_id = $1 AND status = 'Q'",
Args: []interface{}{testdata.Cathy.ID},
Count: 1,
},
},
},
}

handlers.RunTestCases(t, ctx, rt, tcs)
}

func TestNewURN(t *testing.T) {
ctx, rt, db, _ := testsuite.Get()

Expand Down
2 changes: 1 addition & 1 deletion core/hooks/commit_ivr.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var CommitIVRHook models.EventCommitHook = &commitIVRHook{}

type commitIVRHook struct{}

// Apply takes care of inserting all the messages in the passed in scene assigning topups to them as needed.
// Apply takes care of inserting all the messages in the passed in scene.
func (h *commitIVRHook) Apply(ctx context.Context, rt *runtime.Runtime, tx *sqlx.Tx, oa *models.OrgAssets, scenes map[*models.Scene][]interface{}) error {
msgs := make([]*models.Msg, 0, len(scenes))
for _, s := range scenes {
Expand Down
2 changes: 1 addition & 1 deletion core/hooks/commit_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var CommitMessagesHook models.EventCommitHook = &commitMessagesHook{}

type commitMessagesHook struct{}

// Apply takes care of inserting all the messages in the passed in scene assigning topups to them as needed.
// Apply takes care of inserting all the messages in the passed in scene.
func (h *commitMessagesHook) Apply(ctx context.Context, rt *runtime.Runtime, tx *sqlx.Tx, oa *models.OrgAssets, scenes map[*models.Scene][]interface{}) error {
msgs := make([]*models.Msg, 0, len(scenes))
for _, s := range scenes {
Expand Down

0 comments on commit a53d5b4

Please sign in to comment.