Skip to content

Commit

Permalink
Use updated test db
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Sep 4, 2020
1 parent 5b981f4 commit baf7005
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Binary file modified mailroom_test.dump
Binary file not shown.
8 changes: 4 additions & 4 deletions models/contacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func TestContacts(t *testing.T) {

db.MustExec(
`INSERT INTO contacts_contacturn(org_id, contact_id, scheme, path, identity, priority)
VALUES(1, $1, 'whatsapp', '250788373373', 'whatsapp:250788373373', 100)`, BobID)
VALUES(1, $1, 'whatsapp', '250788373373', 'whatsapp:250788373373', 999)`, BobID)

db.MustExec(`DELETE FROM contacts_contacturn WHERE contact_id = $1`, GeorgeID)
db.MustExec(`DELETE FROM contacts_contactgroup_contacts WHERE contact_id = $1`, GeorgeID)
Expand All @@ -444,7 +444,7 @@ func TestContacts(t *testing.T) {
if len(contacts) == 3 {
assert.Equal(t, "Cathy", contacts[0].Name())
assert.Equal(t, len(contacts[0].URNs()), 1)
assert.Equal(t, contacts[0].URNs()[0].String(), "tel:+16055741111?id=10000&priority=50")
assert.Equal(t, contacts[0].URNs()[0].String(), "tel:+16055741111?id=10000&priority=1000")
assert.Equal(t, 1, contacts[0].Groups().Count())

assert.Equal(t, "Yobe", contacts[0].Fields()["state"].QueryValue())
Expand All @@ -455,8 +455,8 @@ func TestContacts(t *testing.T) {
assert.Equal(t, "Bob", contacts[1].Name())
assert.NotNil(t, contacts[1].Fields()["joined"].QueryValue())
assert.Equal(t, 2, len(contacts[1].URNs()))
assert.Equal(t, contacts[1].URNs()[0].String(), "whatsapp:250788373373?id=20121&priority=100")
assert.Equal(t, contacts[1].URNs()[1].String(), "tel:+16055742222?id=10001&priority=50")
assert.Equal(t, contacts[1].URNs()[0].String(), "tel:+16055742222?id=10001&priority=1000")
assert.Equal(t, contacts[1].URNs()[1].String(), "whatsapp:250788373373?id=20121&priority=999")
assert.Equal(t, 0, contacts[1].Groups().Count())

assert.Equal(t, "George", contacts[2].Name())
Expand Down
2 changes: 1 addition & 1 deletion web/contact/testdata/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"timezone": "America/Los_Angeles",
"created_on": "2018-07-06T12:30:00.123457Z",
"urns": [
"tel:+16055741111?id=10000&priority=50"
"tel:+16055741111?id=10000&priority=1000"
]
}
}
Expand Down

0 comments on commit baf7005

Please sign in to comment.