projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/develop' into aliases
[akkoma]
/
test
/
pleroma
/
web
/
pleroma_api
/
controllers
/
chat_controller_test.exs
diff --git
a/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs
b/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs
index c1e6a8cc5e18bddd931b3be6ca33535dd433fd88..415c3decdbca7ffb24d54fdf0648c94182fd29fb 100644
(file)
--- a/
test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs
+++ b/
test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs
@@
-264,9
+264,10
@@
defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
assert length(result) == 3
# Trying to get the chat of a different user
assert length(result) == 3
# Trying to get the chat of a different user
+ other_user_chat = Chat.get(other_user.id, user.ap_id)
+
conn
conn
- |> assign(:user, other_user)
- |> get("/api/v1/pleroma/chats/#{chat.id}/messages")
+ |> get("/api/v1/pleroma/chats/#{other_user_chat.id}/messages")
|> json_response_and_validate_schema(404)
end
end
|> json_response_and_validate_schema(404)
end
end
@@
-393,11
+394,11
@@
defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
tridi = insert(:user)
{:ok, chat_1} = Chat.get_or_create(user.id, har.ap_id)
tridi = insert(:user)
{:ok, chat_1} = Chat.get_or_create(user.id, har.ap_id)
-
:timer.sleep(1000
)
- {:ok,
_
chat_2} = Chat.get_or_create(user.id, jafnhar.ap_id)
-
:timer.sleep(1000
)
+
{:ok, chat_1} = time_travel(chat_1, -3
)
+ {:ok, chat_2} = Chat.get_or_create(user.id, jafnhar.ap_id)
+
{:ok, _chat_2} = time_travel(chat_2, -2
)
{:ok, chat_3} = Chat.get_or_create(user.id, tridi.ap_id)
{:ok, chat_3} = Chat.get_or_create(user.id, tridi.ap_id)
-
:timer.sleep(1000
)
+
{:ok, chat_3} = time_travel(chat_3, -1
)
# bump the second one
{:ok, chat_2} = Chat.bump_or_create(user.id, jafnhar.ap_id)
# bump the second one
{:ok, chat_2} = Chat.bump_or_create(user.id, jafnhar.ap_id)