From 399e9c6f4bbed7f9eac0a75242ec75e4b0d2bb59 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 27 Oct 2015 09:55:19 -0700 Subject: PLT-25 fixing stats for postgres --- store/sql_post_store_test.go | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'store/sql_post_store_test.go') diff --git a/store/sql_post_store_test.go b/store/sql_post_store_test.go index 6795c0663..872423c5a 100644 --- a/store/sql_post_store_test.go +++ b/store/sql_post_store_test.go @@ -672,21 +672,22 @@ func TestPostCountsByDay(t *testing.T) { o1a.Message = "a" + model.NewId() + "b" o1a = Must(store.Post().Save(o1a)).(*model.Post) - // o2 := &model.Post{} - // o2.ChannelId = c1.Id - // o2.UserId = model.NewId() - // o2.CreateAt = o1.CreateAt - (1000 * 60 * 60 * 24 * 2) - // o2.Message = "a" + model.NewId() + "b" - // o2 = Must(store.Post().Save(o2)).(*model.Post) - - // o2a := &model.Post{} - // o2a.ChannelId = c1.Id - // o2a.UserId = o2.UserId - // o2a.CreateAt = o1.CreateAt - (1000 * 60 * 60 * 24 * 2) - // o2a.Message = "a" + model.NewId() + "b" - // o2a = Must(store.Post().Save(o2a)).(*model.Post) + o2 := &model.Post{} + o2.ChannelId = c1.Id + o2.UserId = model.NewId() + o2.CreateAt = o1.CreateAt - (1000 * 60 * 60 * 24 * 2) + o2.Message = "a" + model.NewId() + "b" + o2 = Must(store.Post().Save(o2)).(*model.Post) + + o2a := &model.Post{} + o2a.ChannelId = c1.Id + o2a.UserId = o2.UserId + o2a.CreateAt = o1.CreateAt - (1000 * 60 * 60 * 24 * 2) + o2a.Message = "a" + model.NewId() + "b" + o2a = Must(store.Post().Save(o2a)).(*model.Post) time.Sleep(1 * time.Second) + t.Log(t1.Id) if r1 := <-store.Post().AnalyticsPostCountsByDay(t1.Id); r1.Err != nil { t.Fatal(r1.Err) @@ -697,20 +698,16 @@ func TestPostCountsByDay(t *testing.T) { t.Fatal("wrong value") } - // row2 := r1.Data.(model.AnalyticsRows)[1] - // if row2.Value != 2 { - // t.Fatal("wrong value") - // } + row2 := r1.Data.(model.AnalyticsRows)[1] + if row2.Value != 2 { + t.Fatal("wrong value") + } } if r1 := <-store.Post().AnalyticsPostCount(t1.Id); r1.Err != nil { t.Fatal(r1.Err) } else { - // if r1.Data.(int64) != 4 { - // t.Fatal("wrong value") - // } - - if r1.Data.(int64) != 2 { + if r1.Data.(int64) != 4 { t.Fatal("wrong value") } } -- cgit v1.2.3-1-g7c22