You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
364 B

  1. package models
  2. import (
  3. "testing"
  4. "github.com/arnaucube/gogame/database"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestCreateUser(t *testing.T) {
  8. db, err := database.New("127.0.0.1:27017", "gogametests")
  9. assert.Nil(t, err)
  10. user, err := NewUser(db, "user00", "password00", "user00@email.com")
  11. assert.Nil(t, err)
  12. assert.Equal(t, user.Name, "user00")
  13. }