diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-02 08:36:56 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-02 08:36:56 -0700 |
commit | b2052de746f8e5f4ca600142fd43b64ceb6c8b84 (patch) | |
tree | 99474e75e399fc530a73cfb3cdc10d74bcbc0b01 /model/channel_member_test.go | |
parent | 9d688821aa8bb8d766793aeaec6920f9985a30a3 (diff) | |
parent | c427e9c9d6fbd68662fdfbbe733af4b34ae69269 (diff) | |
download | chat-b2052de746f8e5f4ca600142fd43b64ceb6c8b84.tar.gz chat-b2052de746f8e5f4ca600142fd43b64ceb6c8b84.tar.bz2 chat-b2052de746f8e5f4ca600142fd43b64ceb6c8b84.zip |
Merge branch 'master' into PLT-462
Diffstat (limited to 'model/channel_member_test.go')
-rw-r--r-- | model/channel_member_test.go | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/model/channel_member_test.go b/model/channel_member_test.go index 3b64ffbf7..edbb46e9b 100644 --- a/model/channel_member_test.go +++ b/model/channel_member_test.go @@ -31,24 +31,34 @@ func TestChannelMemberIsValid(t *testing.T) { } o.Roles = "missing" - o.NotifyLevel = CHANNEL_NOTIFY_ALL + o.NotifyProps = GetDefaultChannelNotifyProps() o.UserId = NewId() if err := o.IsValid(); err == nil { t.Fatal("should be invalid") } o.Roles = CHANNEL_ROLE_ADMIN - o.NotifyLevel = "junk" + o.NotifyProps["desktop"] = "junk" if err := o.IsValid(); err == nil { t.Fatal("should be invalid") } - o.NotifyLevel = "123456789012345678901" + o.NotifyProps["desktop"] = "123456789012345678901" if err := o.IsValid(); err == nil { t.Fatal("should be invalid") } - o.NotifyLevel = CHANNEL_NOTIFY_ALL + o.NotifyProps["desktop"] = CHANNEL_NOTIFY_ALL + if err := o.IsValid(); err != nil { + t.Fatal(err) + } + + o.NotifyProps["mark_unread"] = "123456789012345678901" + if err := o.IsValid(); err == nil { + t.Fatal("should be invalid") + } + + o.NotifyProps["mark_unread"] = CHANNEL_MARK_UNREAD_ALL if err := o.IsValid(); err != nil { t.Fatal(err) } |