Move remaining actions over to use redux and v4 endpoints (#6720)

Этот коммит содержится в:
Joram Wilander
2017-06-26 08:16:57 -04:00
коммит произвёл GitHub
родитель fe7e9d95b3
Коммит 23ccfc845c
76 изменённых файлов: 686 добавлений и 6975 удалений

Просмотреть файл

@@ -752,6 +752,23 @@ func TestGetPost(t *testing.T) {
CheckBadRequestStatus(t, resp)
_, resp = Client.GetPost(model.NewId(), "")
CheckNotFoundStatus(t, resp)
Client.RemoveUserFromChannel(th.BasicChannel.Id, th.BasicUser.Id)
// Channel is public, should be able to read post
post, resp = Client.GetPost(th.BasicPost.Id, "")
CheckNoError(t, resp)
privatePost := th.CreatePostWithClient(Client, th.BasicPrivateChannel)
post, resp = Client.GetPost(privatePost.Id, "")
CheckNoError(t, resp)
Client.RemoveUserFromChannel(th.BasicPrivateChannel.Id, th.BasicUser.Id)
// Channel is private, should not be able to read post
post, resp = Client.GetPost(privatePost.Id, "")
CheckForbiddenStatus(t, resp)
Client.Logout()
@@ -831,6 +848,23 @@ func TestGetPostThread(t *testing.T) {
CheckBadRequestStatus(t, resp)
_, resp = Client.GetPostThread(model.NewId(), "")
CheckNotFoundStatus(t, resp)
Client.RemoveUserFromChannel(th.BasicChannel.Id, th.BasicUser.Id)
// Channel is public, should be able to read post
_, resp = Client.GetPostThread(th.BasicPost.Id, "")
CheckNoError(t, resp)
privatePost := th.CreatePostWithClient(Client, th.BasicPrivateChannel)
_, resp = Client.GetPostThread(privatePost.Id, "")
CheckNoError(t, resp)
Client.RemoveUserFromChannel(th.BasicPrivateChannel.Id, th.BasicUser.Id)
// Channel is private, should not be able to read post
_, resp = Client.GetPostThread(privatePost.Id, "")
CheckForbiddenStatus(t, resp)
Client.Logout()