commenter_session_update_test.go: verify update

Fixes https://gitlab.com/commento/commento-ce/issues/53
This commit is contained in:
Adhityaa 2018-06-20 09:11:11 +05:30
parent da3fa3cd41
commit 237a02bee9

View File

@ -13,6 +13,24 @@ func TestCommenterSessionUpdateBasics(t *testing.T) {
t.Errorf("unexpected error updating commenter session: %v", err) t.Errorf("unexpected error updating commenter session: %v", err)
return return
} }
statement := `
SELECT commenterHex
FROM commenterSessions
WHERE commenterToken = $1;
`
row := db.QueryRow(statement, commenterToken)
var commenterHex string
if err := row.Scan(&commenterHex); err != nil {
t.Errorf("error scanning commenterHex: %v", err)
return
}
if commenterHex != "temp-commenter-hex" {
t.Errorf("expected commenterHex=temp-commenter-hex got commenterHex=%s", commenterHex)
return
}
} }
func TestCommenterSessionUpdateEmpty(t *testing.T) { func TestCommenterSessionUpdateEmpty(t *testing.T) {