/user/store/index/elasticsearch/create_index_integration_test.go
Go | 28 lines | 21 code | 6 blank | 1 comment | 0 complexity | 19d66308f21c502cbe925f4e1c0f4ed9 MD5 | raw file
- // +build integration
- package user_store_elasticsearch_test
- import (
- "bitbucket.org/epicglue/api/helpers"
- "bitbucket.org/epicglue/api/helpers/test"
- "bitbucket.org/epicglue/api/model"
- "bitbucket.org/epicglue/api/user/store/index/elasticsearch"
- "github.com/stretchr/testify/assert"
- "github.com/yezooz/null"
- "testing"
- )
- func TestNewUser(t *testing.T) {
- userStore := user_store_elasticsearch.NewUserStoreElasticsearch()
- newUser := &model.User{
- Id: helpers.RandomNumber(8),
- Email: helpers.RandomEmail(),
- Password: null.StringFrom(helpers.RandomString(8)),
- PlanName: model.PLAN_FREE,
- }
- assert.Nil(t, userStore.CreateIndexForUser(newUser))
- assert.True(t, test_helper.HasIndex(newUser.IndexName()))
- }