diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-02-02 11:46:42 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-02-02 11:46:42 -0500 |
commit | 365514174ef00dcf426b2b5704c3d7adebe926e1 (patch) | |
tree | 41f5544aed1b822ae4e476c9ede496ce740d5048 /store/sql_team_store_test.go | |
parent | 60be5c902fe30c978d5b30f265509dc28c451407 (diff) | |
download | chat-365514174ef00dcf426b2b5704c3d7adebe926e1.tar.gz chat-365514174ef00dcf426b2b5704c3d7adebe926e1.tar.bz2 chat-365514174ef00dcf426b2b5704c3d7adebe926e1.zip |
Add tear down to APIv4 tests (#5250)
* Add tear down to APIv4 tests
* Defer tear downs
Diffstat (limited to 'store/sql_team_store_test.go')
-rw-r--r-- | store/sql_team_store_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/store/sql_team_store_test.go b/store/sql_team_store_test.go index 0ea499d7e..62efa4d1a 100644 --- a/store/sql_team_store_test.go +++ b/store/sql_team_store_test.go @@ -132,6 +132,28 @@ func TestTeamStoreGetByName(t *testing.T) { } } +func TestTeamStoreSearchByName(t *testing.T) { + Setup() + + o1 := model.Team{} + o1.DisplayName = "DisplayName" + o1.Name = "zzz" + model.NewId() + "b" + o1.Email = model.NewId() + "@nowhere.com" + o1.Type = model.TEAM_OPEN + + if err := (<-store.Team().Save(&o1)).Err; err != nil { + t.Fatal(err) + } + + if r1 := <-store.Team().SearchByName("zzz"); r1.Err != nil { + t.Fatal(r1.Err) + } else { + if r1.Data.([]*model.Team)[0].ToJson() != o1.ToJson() { + t.Fatal("invalid returned team") + } + } +} + func TestTeamStoreGetByIniviteId(t *testing.T) { Setup() |