1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-11-23 22:14:49 +02:00

Fix confirm's initial test.

- Add e-mail templates for confirm.
This commit is contained in:
Aaron
2015-02-10 16:29:52 -08:00
parent a91a7ef162
commit 127ef8ea17
5 changed files with 103 additions and 8 deletions

47
confirm/confirm_test.go Normal file
View File

@@ -0,0 +1,47 @@
package confirm
import (
"html/template"
"testing"
"gopkg.in/authboss.v0"
"gopkg.in/authboss.v0/internal/mocks"
)
func setup() *Confirm {
config := authboss.NewConfig()
config.Storer = mocks.NewMockStorer()
config.LayoutEmail = template.Must(template.New("").Parse(`email ^_^`))
c := &Confirm{}
if err := c.Initialize(config); err != nil {
panic(err)
}
return c
}
func TestConfirm_Initialize(t *testing.T) {
c := &Confirm{}
if err := c.Initialize(authboss.NewConfig()); err == nil {
t.Error("Should cry about not having a storer.")
}
c = setup()
if c.config == nil {
t.Error("Missing config")
}
if c.logger == nil {
t.Error("Missing logger")
}
if c.storer == nil {
t.Error("Missing storer")
}
if c.emailTemplates == nil {
t.Error("Missing email templates")
}
}