summaryrefslogtreecommitdiffstats
path: root/api/channel_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-06-15 08:00:55 -0400
committerGitHub <noreply@github.com>2016-06-15 08:00:55 -0400
commit1cfb35fd32478917ddf8becb7e438280db19d66a (patch)
treeb5f0e3157201767f2fd7df87be73617034f35a42 /api/channel_test.go
parentf6b4a611d0ef28d5f08959a51c31ad480df1883a (diff)
downloadchat-1cfb35fd32478917ddf8becb7e438280db19d66a.tar.gz
chat-1cfb35fd32478917ddf8becb7e438280db19d66a.tar.bz2
chat-1cfb35fd32478917ddf8becb7e438280db19d66a.zip
Fix channels showing up across teams when multiple teams open in same browser (#3329)
Diffstat (limited to 'api/channel_test.go')
-rw-r--r--api/channel_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/api/channel_test.go b/api/channel_test.go
index 5c51e4d93..7480dea23 100644
--- a/api/channel_test.go
+++ b/api/channel_test.go
@@ -320,6 +320,7 @@ func TestGetChannel(t *testing.T) {
th := Setup().InitBasic()
Client := th.BasicClient
team := th.BasicTeam
+ team2 := th.CreateTeam(Client)
channel1 := &model.Channel{DisplayName: "A Test API Name", Name: "a" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id}
channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel)
@@ -370,6 +371,11 @@ func TestGetChannel(t *testing.T) {
if _, err := Client.GetChannel("junk", ""); err == nil {
t.Fatal("should have failed - bad channel id")
}
+
+ Client.SetTeamId(team2.Id)
+ if _, err := Client.GetChannel(channel2.Id, ""); err == nil {
+ t.Fatal("should have failed - wrong team")
+ }
}
func TestGetMoreChannel(t *testing.T) {