first commit
This commit is contained in:
28
app/accounts/models/accounts_test.go
Normal file
28
app/accounts/models/accounts_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package models
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestUserIsEmailVerified(t *testing.T) {
|
||||
t.Run("nil pointer returns false", func(t *testing.T) {
|
||||
u := User{}
|
||||
if u.IsEmailVerified() {
|
||||
t.Fatalf("expected false for nil EmailVerified")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("true pointer returns true", func(t *testing.T) {
|
||||
v := true
|
||||
u := User{EmailVerified: &v}
|
||||
if !u.IsEmailVerified() {
|
||||
t.Fatalf("expected true")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("false pointer returns false", func(t *testing.T) {
|
||||
v := false
|
||||
u := User{EmailVerified: &v}
|
||||
if u.IsEmailVerified() {
|
||||
t.Fatalf("expected false")
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user