email_template_test.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package email
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestEmailNotifyEmailTemplate(t *testing.T) {
  7. var (
  8. params = map[string]string{
  9. "aid": "444",
  10. "title": "随意一个标题",
  11. "upName": "随意一个up主昵称",
  12. "condition": "优质up主",
  13. "change": "",
  14. "username": "cxxx",
  15. "department": "r&d",
  16. "typeId": "4",
  17. "fromVideo": "false",
  18. "uid": "441",
  19. }
  20. )
  21. convey.Convey("NotifyEmailTemplate", t, func(ctx convey.C) {
  22. tpl := d.NotifyEmailTemplate(params)
  23. ctx.Convey("Then tpl should not be nil.", func(ctx convey.C) {
  24. ctx.So(tpl, convey.ShouldNotBeNil)
  25. })
  26. })
  27. }
  28. func TestEmailPrivateEmailTemplate(t *testing.T) {
  29. var (
  30. params = map[string]string{
  31. "aid": "444",
  32. "title": "随意一个标题",
  33. "upName": "随意一个up主昵称",
  34. "condition": "优质up主",
  35. "change": "",
  36. "username": "cxxx",
  37. "department": "r&d",
  38. "typeId": "4",
  39. "fromVideo": "false",
  40. "uid": "441",
  41. }
  42. )
  43. convey.Convey("PrivateEmailTemplate", t, func(ctx convey.C) {
  44. tpl := d.PrivateEmailTemplate(params)
  45. ctx.Convey("Then tpl should not be nil.", func(ctx convey.C) {
  46. ctx.So(tpl, convey.ShouldNotBeNil)
  47. })
  48. })
  49. }