From 237a02bee939e31dbc085866e2622450f5a8e55f Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Wed, 20 Jun 2018 09:11:11 +0530 Subject: [PATCH] commenter_session_update_test.go: verify update Fixes https://gitlab.com/commento/commento-ce/issues/53 --- api/commenter_session_update_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api/commenter_session_update_test.go b/api/commenter_session_update_test.go index 9d27bc6..327537c 100644 --- a/api/commenter_session_update_test.go +++ b/api/commenter_session_update_test.go @@ -13,6 +13,24 @@ func TestCommenterSessionUpdateBasics(t *testing.T) { t.Errorf("unexpected error updating commenter session: %v", err) 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) {