mirror of
https://github.com/arnaucube/gogame.git
synced 2026-02-07 11:36:40 +01:00
add some User functions, move api tests from js to python
This commit is contained in:
17
models/user_test.go
Normal file
17
models/user_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/arnaucube/gogame/database"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCreateUser(t *testing.T) {
|
||||
db, err := database.New("127.0.0.1:27017", "gogametests")
|
||||
assert.Nil(t, err)
|
||||
|
||||
user, err := NewUser(db, "user00", "password00", "user00@email.com")
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, user.Name, "user00")
|
||||
}
|
||||
Reference in New Issue
Block a user