Implement endpoint for APIv4: GET /users/{user_id}/audits (#5472)

This commit is contained in:
Saturnino Abril
2017-02-21 21:07:57 +09:00
committed by George Goldberg
parent 7068307a1c
commit 5c19d9be7f
7 changed files with 113 additions and 47 deletions

View File

@@ -4,9 +4,10 @@
package store
import (
"github.com/mattermost/platform/model"
"testing"
"time"
"github.com/mattermost/platform/model"
)
func TestSqlAuditStore(t *testing.T) {
@@ -25,7 +26,7 @@ func TestSqlAuditStore(t *testing.T) {
time.Sleep(100 * time.Millisecond)
c := store.Audit().Get(audit.UserId, 100)
c := store.Audit().Get(audit.UserId, 0, 100)
result := <-c
audits := result.Data.(model.Audits)
@@ -37,7 +38,7 @@ func TestSqlAuditStore(t *testing.T) {
t.Fatal("Failed to save property for extra info")
}
c = store.Audit().Get("missing", 100)
c = store.Audit().Get("missing", 0, 100)
result = <-c
audits = result.Data.(model.Audits)
@@ -45,7 +46,7 @@ func TestSqlAuditStore(t *testing.T) {
t.Fatal("Should have returned empty because user_id is missing")
}
c = store.Audit().Get("", 100)
c = store.Audit().Get("", 0, 100)
result = <-c
audits = result.Data.(model.Audits)