summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/emoji_test.go2
-rw-r--r--api/post_test.go10
-rw-r--r--api/user.go2
3 files changed, 6 insertions, 8 deletions
diff --git a/api/emoji_test.go b/api/emoji_test.go
index 8aae047d4..f4e376bd2 100644
--- a/api/emoji_test.go
+++ b/api/emoji_test.go
@@ -206,7 +206,7 @@ func TestCreateEmoji(t *testing.T) {
CreatorId: th.BasicUser.Id,
Name: model.NewId(),
}
- if _, err := Client.CreateEmoji(emoji, make([]byte, 100, 100), "image.gif"); err == nil {
+ if _, err := Client.CreateEmoji(emoji, make([]byte, 100), "image.gif"); err == nil {
t.Fatal("shouldn't be able to create an emoji with non-image data")
}
diff --git a/api/post_test.go b/api/post_test.go
index 138b3dcb9..cb6b2bfb2 100644
--- a/api/post_test.go
+++ b/api/post_test.go
@@ -1321,7 +1321,7 @@ func TestGetFileInfosForPost(t *testing.T) {
Client := th.BasicClient
channel1 := th.BasicChannel
- fileIds := make([]string, 3, 3)
+ fileIds := make([]string, 3)
if data, err := readTestFile("test.png"); err != nil {
t.Fatal(err)
} else {
@@ -1531,7 +1531,7 @@ func TestPinPost(t *testing.T) {
if rupost1, err := Client.PinPost(post.ChannelId, post.Id); err != nil {
t.Fatal(err)
} else {
- if rupost1.Data.(*model.Post).IsPinned != true {
+ if !rupost1.Data.(*model.Post).IsPinned {
t.Fatal("failed to pin post")
}
}
@@ -1540,7 +1540,7 @@ func TestPinPost(t *testing.T) {
if rupost2, err := Client.PinPost(pinnedPost.ChannelId, pinnedPost.Id); err != nil {
t.Fatal(err)
} else {
- if rupost2.Data.(*model.Post).IsPinned != true {
+ if !rupost2.Data.(*model.Post).IsPinned {
t.Fatal("pinning a post should be idempotent")
}
}
@@ -1556,7 +1556,7 @@ func TestUnpinPost(t *testing.T) {
if rupost1, err := Client.UnpinPost(pinnedPost.ChannelId, pinnedPost.Id); err != nil {
t.Fatal(err)
} else {
- if rupost1.Data.(*model.Post).IsPinned != false {
+ if rupost1.Data.(*model.Post).IsPinned {
t.Fatal("failed to unpin post")
}
}
@@ -1565,7 +1565,7 @@ func TestUnpinPost(t *testing.T) {
if rupost2, err := Client.UnpinPost(post.ChannelId, post.Id); err != nil {
t.Fatal(err)
} else {
- if rupost2.Data.(*model.Post).IsPinned != false {
+ if rupost2.Data.(*model.Post).IsPinned {
t.Fatal("unpinning a post should be idempotent")
}
}
diff --git a/api/user.go b/api/user.go
index e6f3327ba..1060d1bda 100644
--- a/api/user.go
+++ b/api/user.go
@@ -1167,7 +1167,6 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
c.App.AddDirectChannels(teamId, user)
})
}
- break
case model.OAUTH_ACTION_EMAIL_TO_SSO:
if err := c.App.RevokeAllSessions(user.Id); err != nil {
c.Err = err
@@ -1179,7 +1178,6 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
l4g.Error(err.Error())
}
})
- break
}
doLogin(c, w, r, user, "")
if c.Err != nil {