1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-08 22:36:41 +02:00

Fixed web-app from breaking changes

This commit is contained in:
Lee Brown
2019-08-05 17:23:56 -08:00
parent 53b9424e95
commit 7a7510cdc5
5 changed files with 42 additions and 25 deletions

View File

@ -192,12 +192,9 @@ func TestSendUserInvites(t *testing.T) {
// Assuming we have received the email and clicked the link, we now can ensure accept works.
for idx, inviteHash := range inviteHashes {
type expectRes struct {
UserID string `json:"user_id" validate:"required,uuid"`
}
var res expectRes
newPass := uuid.NewRandom().String()
res.UserID, err = AcceptInvite(ctx, test.MasterDB, AcceptInviteRequest{
hash, err := AcceptInvite(ctx, test.MasterDB, AcceptInviteRequest{
InviteHash: inviteHash,
Email: inviteEmails[idx],
FirstName: "Foo",
@ -211,7 +208,14 @@ func TestSendUserInvites(t *testing.T) {
}
// Validate the result.
err := webcontext.Validator().StructCtx(ctx, res)
var res = struct {
UserID string `validate:"required,uuid"`
AccountID string `validate:"required,uuid"`
}{
UserID: hash.UserID,
AccountID: hash.AccountID,
}
err = webcontext.Validator().StructCtx(ctx, res)
if err != nil {
t.Log("\t\tGot :", err)
t.Fatalf("\t%s\tInviteAccept failed.", tests.Failed)