summaryrefslogtreecommitdiffstats
path: root/model/channel_search_test.go
blob: 97c1b3ecdb75556faf9de72435a78899cbfc546b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package model

import (
	"strings"
	"testing"
)

func TestChannelSearchJson(t *testing.T) {
	channelSearch := ChannelSearch{Term: NewId()}
	json := channelSearch.ToJson()
	rchannelSearch := ChannelSearchFromJson(strings.NewReader(json))

	if channelSearch.Term != rchannelSearch.Term {
		t.Fatal("Terms do not match")
	}
}