PageRenderTime 23ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/user/store/db/postgres/store_feedback_integration_test.go

https://gitlab.com/epicglue/api
Go | 31 lines | 22 code | 8 blank | 1 comment | 0 complexity | 3db4850185ef2139526e42b14706cd3a MD5 | raw file
  1. // +build integration
  2. package user_store_postgres_test
  3. import (
  4. "bitbucket.org/epicglue/api/helpers"
  5. "bitbucket.org/epicglue/api/model"
  6. "bitbucket.org/epicglue/api/user/store/db/postgres"
  7. "github.com/stretchr/testify/assert"
  8. "testing"
  9. )
  10. func TestFeedbackValidation(t *testing.T) {
  11. userStore := user_store_postgres.NewUserStorePostgres()
  12. assert.NotNil(t, userStore.SaveFeedbackForUser(nil, ""))
  13. assert.NotNil(t, userStore.SaveFeedbackForUser(&model.User{
  14. Id: 1,
  15. }, ""))
  16. }
  17. func TestNewFeedback(t *testing.T) {
  18. userStore := user_store_postgres.NewUserStorePostgres()
  19. feedbackContent := helpers.RandomString(8)
  20. assert.Nil(t, userStore.SaveFeedbackForUser(&model.User{
  21. Id: 1,
  22. }, feedbackContent))
  23. }