summaryrefslogtreecommitdiffstats
path: root/app/notification_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-04 13:09:41 -0700
committerGitHub <noreply@github.com>2017-10-04 13:09:41 -0700
commit07777f5ff9e0bde26abd0288164e5f73b6da992a (patch)
treeb0aa1eff510d1531d2924522e0e6f0e9bfd7ac29 /app/notification_test.go
parentdc9b1a1d6a0fe7ad2e18597cb46f3874736b4b40 (diff)
downloadchat-07777f5ff9e0bde26abd0288164e5f73b6da992a.tar.gz
chat-07777f5ff9e0bde26abd0288164e5f73b6da992a.tar.bz2
chat-07777f5ff9e0bde26abd0288164e5f73b6da992a.zip
Fix races / finally remove global app for good (#7570)
* finally remove global app for good * test compilation fixes * fix races * fix deadlock * wake up write pump so it doesn't take forever to clean up
Diffstat (limited to 'app/notification_test.go')
-rw-r--r--app/notification_test.go29
1 files changed, 26 insertions, 3 deletions
diff --git a/app/notification_test.go b/app/notification_test.go
index 28c931d1f..f5224e84e 100644
--- a/app/notification_test.go
+++ b/app/notification_test.go
@@ -13,6 +13,7 @@ import (
func TestSendNotifications(t *testing.T) {
th := Setup().InitBasic()
+ defer th.TearDown()
th.App.AddUserToChannel(th.BasicUser2, th.BasicChannel)
@@ -408,7 +409,9 @@ func TestRemoveCodeFromMessage(t *testing.T) {
}
func TestGetMentionKeywords(t *testing.T) {
- Setup()
+ th := Setup()
+ defer th.TearDown()
+
// user with username or custom mentions enabled
user1 := &model.User{
Id: model.NewId(),
@@ -856,7 +859,9 @@ func TestDoesStatusAllowPushNotification(t *testing.T) {
}
func TestGetDirectMessageNotificationEmailSubject(t *testing.T) {
- Setup()
+ th := Setup()
+ defer th.TearDown()
+
expectedPrefix := "[http://localhost:8065] New Direct Message from sender on"
post := &model.Post{
CreateAt: 1501804801000,
@@ -869,7 +874,9 @@ func TestGetDirectMessageNotificationEmailSubject(t *testing.T) {
}
func TestGetNotificationEmailSubject(t *testing.T) {
- Setup()
+ th := Setup()
+ defer th.TearDown()
+
expectedPrefix := "[http://localhost:8065] Notification in team on"
post := &model.Post{
CreateAt: 1501804801000,
@@ -883,6 +890,8 @@ func TestGetNotificationEmailSubject(t *testing.T) {
func TestGetNotificationEmailBodyFullNotificationPublicChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -917,6 +926,8 @@ func TestGetNotificationEmailBodyFullNotificationPublicChannel(t *testing.T) {
func TestGetNotificationEmailBodyFullNotificationGroupChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -951,6 +962,8 @@ func TestGetNotificationEmailBodyFullNotificationGroupChannel(t *testing.T) {
func TestGetNotificationEmailBodyFullNotificationPrivateChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -985,6 +998,8 @@ func TestGetNotificationEmailBodyFullNotificationPrivateChannel(t *testing.T) {
func TestGetNotificationEmailBodyFullNotificationDirectChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -1017,6 +1032,8 @@ func TestGetNotificationEmailBodyFullNotificationDirectChannel(t *testing.T) {
// from here
func TestGetNotificationEmailBodyGenericNotificationPublicChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -1048,6 +1065,8 @@ func TestGetNotificationEmailBodyGenericNotificationPublicChannel(t *testing.T)
func TestGetNotificationEmailBodyGenericNotificationGroupChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -1079,6 +1098,8 @@ func TestGetNotificationEmailBodyGenericNotificationGroupChannel(t *testing.T) {
func TestGetNotificationEmailBodyGenericNotificationPrivateChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",
@@ -1110,6 +1131,8 @@ func TestGetNotificationEmailBodyGenericNotificationPrivateChannel(t *testing.T)
func TestGetNotificationEmailBodyGenericNotificationDirectChannel(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
recipient := &model.User{}
post := &model.Post{
Message: "This is the message",