projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Email admins when a new unapproved account is up for review
[akkoma]
/
test
/
web
/
ostatus
/
ostatus_controller_test.exs
diff --git
a/test/web/ostatus/ostatus_controller_test.exs
b/test/web/ostatus/ostatus_controller_test.exs
index 266fe2f4544c51c5de8c1eabdc60d53db999857c..ee498f4b555ea10022ac07dbe91f2f6713f88900 100644
(file)
--- a/
test/web/ostatus/ostatus_controller_test.exs
+++ b/
test/web/ostatus/ostatus_controller_test.exs
@@
-26,10
+26,7
@@
defmodule Pleroma.Web.OStatus.OStatusControllerTest do
describe "Mastodon compatibility routes" do
setup %{conn: conn} do
conn = put_req_header(conn, "accept", "text/html")
describe "Mastodon compatibility routes" do
setup %{conn: conn} do
conn = put_req_header(conn, "accept", "text/html")
- %{conn: conn}
- end
- test "redirects to /notice/:id for html format", %{conn: conn} do
{:ok, object} =
%{
"type" => "Note",
{:ok, object} =
%{
"type" => "Note",
@@
-42,6
+39,7
@@
defmodule Pleroma.Web.OStatus.OStatusControllerTest do
{:ok, activity, _} =
%{
{:ok, activity, _} =
%{
+ "id" => object.data["id"] <> "/activity",
"type" => "Create",
"object" => object.data["id"],
"actor" => object.data["actor"],
"type" => "Create",
"object" => object.data["id"],
"actor" => object.data["actor"],
@@
-49,9
+47,21
@@
defmodule Pleroma.Web.OStatus.OStatusControllerTest do
}
|> ActivityPub.persist(local: true)
}
|> ActivityPub.persist(local: true)
+ %{conn: conn, activity: activity}
+ end
+
+ test "redirects to /notice/:id for html format", %{conn: conn, activity: activity} do
conn = get(conn, "/users/raymoo/statuses/999999999")
assert redirected_to(conn) == "/notice/#{activity.id}"
end
conn = get(conn, "/users/raymoo/statuses/999999999")
assert redirected_to(conn) == "/notice/#{activity.id}"
end
+
+ test "redirects to /notice/:id for html format for activity", %{
+ conn: conn,
+ activity: activity
+ } do
+ conn = get(conn, "/users/raymoo/statuses/999999999/activity")
+ assert redirected_to(conn) == "/notice/#{activity.id}"
+ end
end
# Note: see ActivityPubControllerTest for JSON format tests
end
# Note: see ActivityPubControllerTest for JSON format tests