Skip to content

Commit

Permalink
Merge pull request rapidpro#411 from nyaruka/copypasta
Browse files Browse the repository at this point in the history
Minor copypasta
  • Loading branch information
rowanseymour authored Feb 18, 2021
2 parents 3468758 + 7e9b2be commit 44009d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions core/models/test_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ var ZendeskUUID = assets.TicketerUUID("4ee6d4f3-f92b-439b-9718-8da90c05490b")
var RocketChatID = TicketerID(3)
var RocketChatUUID = assets.TicketerUUID("6c50665f-b4ff-4e37-9625-bc464fe6a999")

var InternalID = TicketerID(4)
var InternalUUID = assets.TicketerUUID("8bd48029-6ca1-46a8-aa14-68f7213b82b3")

// constants for org 2, just a few here

var Org2 = OrgID(2)
Expand Down
8 changes: 4 additions & 4 deletions services/tickets/intern/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestOpenAndForward(t *testing.T) {

assert.Equal(t, 0, len(logger.Logs))

dbTicket := models.NewTicket(ticket.UUID, models.Org1, models.CathyID, models.MailgunID, "", "Need help", "Where are my cookies?", nil)
dbTicket := models.NewTicket(ticket.UUID, models.Org1, models.CathyID, models.InternalID, "", "Need help", "Where are my cookies?", nil)

logger = &flows.HTTPLogger{}
err = svc.Forward(
Expand All @@ -69,13 +69,13 @@ func TestCloseAndReopen(t *testing.T) {
defer uuids.SetGenerator(uuids.DefaultGenerator)
uuids.SetGenerator(uuids.NewSeededGenerator(12345))

ticketer := flows.NewTicketer(types.NewTicketer(assets.TicketerUUID(uuids.New()), "Support", "mailgun"))
ticketer := flows.NewTicketer(types.NewTicketer(assets.TicketerUUID(uuids.New()), "Support", "internal"))
svc, err := intern.NewService(http.DefaultClient, nil, ticketer, nil)
require.NoError(t, err)

logger := &flows.HTTPLogger{}
ticket1 := models.NewTicket("88bfa1dc-be33-45c2-b469-294ecb0eba90", models.Org1, models.CathyID, models.ZendeskID, "12", "New ticket", "Where my cookies?", nil)
ticket2 := models.NewTicket("645eee60-7e84-4a9e-ade3-4fce01ae28f1", models.Org1, models.BobID, models.ZendeskID, "14", "Second ticket", "Where my shoes?", nil)
ticket1 := models.NewTicket("88bfa1dc-be33-45c2-b469-294ecb0eba90", models.Org1, models.CathyID, models.InternalID, "12", "New ticket", "Where my cookies?", nil)
ticket2 := models.NewTicket("645eee60-7e84-4a9e-ade3-4fce01ae28f1", models.Org1, models.BobID, models.InternalID, "14", "Second ticket", "Where my shoes?", nil)

err = svc.Close([]*models.Ticket{ticket1, ticket2}, logger.Log)

Expand Down
2 changes: 1 addition & 1 deletion web/ticket/ticket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestTicketClose(t *testing.T) {
testsuite.Reset()
db := testsuite.DB()

// create 2 open tickets and 1 closed one for Cathy
// create 2 open tickets and 1 closed one for Cathy across two different ticketers
testdata.InsertOpenTicket(t, db, models.Org1, models.CathyID, models.MailgunID, flows.TicketUUID(uuids.New()), "Need help", "Have you seen my cookies?", "17")
testdata.InsertOpenTicket(t, db, models.Org1, models.CathyID, models.ZendeskID, flows.TicketUUID(uuids.New()), "More help", "Have you seen my cookies?", "21")
testdata.InsertClosedTicket(t, db, models.Org1, models.CathyID, models.ZendeskID, flows.TicketUUID(uuids.New()), "Old question", "Have you seen my cookies?", "34")
Expand Down

0 comments on commit 44009d8

Please sign in to comment.