signup: fix email sent logic for tempuser

Fixes #8656 and properly sets the email_sent and email_sent_on fields
for a tempuser (signup user).
This commit is contained in:
Daniel Lee
2017-06-30 20:21:08 +02:00
parent fb99ddf295
commit b8aa203707
6 changed files with 46 additions and 1 deletions
+13
View File
@@ -54,6 +54,19 @@ func TestTempUserCommandsAndQueries(t *testing.T) {
So(err, ShouldBeNil)
})
Convey("Should be able update email sent and email sent on", func() {
cmd3 := m.UpdateTempUserWithEmailSentCommand{Code: cmd.Result.Code}
err := UpdateTempUserWithEmailSent(&cmd3)
So(err, ShouldBeNil)
query := m.GetTempUsersQuery{OrgId: 2256, Status: m.TmpUserInvitePending}
err = GetTempUsersQuery(&query)
So(err, ShouldBeNil)
So(query.Result[0].EmailSent, ShouldBeTrue)
So(query.Result[0].EmailSentOn, ShouldHappenOnOrAfter, (query.Result[0].Created))
})
})
})
}