PageRenderTime 68ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/user/store/index/elasticsearch/create_index_integration_test.go

https://gitlab.com/epicglue/api
Go | 28 lines | 21 code | 6 blank | 1 comment | 0 complexity | 19d66308f21c502cbe925f4e1c0f4ed9 MD5 | raw file
  1. // +build integration
  2. package user_store_elasticsearch_test
  3. import (
  4. "bitbucket.org/epicglue/api/helpers"
  5. "bitbucket.org/epicglue/api/helpers/test"
  6. "bitbucket.org/epicglue/api/model"
  7. "bitbucket.org/epicglue/api/user/store/index/elasticsearch"
  8. "github.com/stretchr/testify/assert"
  9. "github.com/yezooz/null"
  10. "testing"
  11. )
  12. func TestNewUser(t *testing.T) {
  13. userStore := user_store_elasticsearch.NewUserStoreElasticsearch()
  14. newUser := &model.User{
  15. Id: helpers.RandomNumber(8),
  16. Email: helpers.RandomEmail(),
  17. Password: null.StringFrom(helpers.RandomString(8)),
  18. PlanName: model.PLAN_FREE,
  19. }
  20. assert.Nil(t, userStore.CreateIndexForUser(newUser))
  21. assert.True(t, test_helper.HasIndex(newUser.IndexName()))
  22. }