test: cover string user ids in workbench payloads
This commit is contained in:
@@ -22,12 +22,9 @@ func TestUserIDJSONAcceptsIMUserID(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUserIDJSONStillAcceptsNumericID(t *testing.T) {
|
||||
func TestUserIDJSONRejectsNumericID(t *testing.T) {
|
||||
var id userID
|
||||
if err := json.Unmarshal([]byte(`1573862062872858624`), &id); err != nil {
|
||||
t.Fatalf("unmarshal numeric: %v", err)
|
||||
}
|
||||
if id != 1573862062872858624 {
|
||||
t.Fatalf("id=%d", id)
|
||||
if err := json.Unmarshal([]byte(`1573862062872858624`), &id); err == nil {
|
||||
t.Fatal("expected numeric user id to be rejected")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user