Merge branch 'remake-remodel' into develop
This commit is contained in:
commit
3c2c32b460
36 changed files with 862 additions and 85 deletions
|
|
@ -194,10 +194,10 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
{:ok, private_activity} =
|
||||
CommonAPI.post(other_user, %{"status" => ".", "visibility" => "private"})
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(public_activity.id, user)
|
||||
{:ok, _, _} = CommonAPI.favorite(direct_activity.id, user)
|
||||
{:ok, _, _} = CommonAPI.favorite(unlisted_activity.id, user)
|
||||
{:ok, _, _} = CommonAPI.favorite(private_activity.id, user)
|
||||
{:ok, _} = CommonAPI.favorite(user, public_activity.id)
|
||||
{:ok, _} = CommonAPI.favorite(user, direct_activity.id)
|
||||
{:ok, _} = CommonAPI.favorite(user, unlisted_activity.id)
|
||||
{:ok, _} = CommonAPI.favorite(user, private_activity.id)
|
||||
|
||||
activity_ids =
|
||||
conn
|
||||
|
|
@ -274,7 +274,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
|
||||
{:ok, mention_activity} = CommonAPI.post(other_user, %{"status" => "hey @#{user.nickname}"})
|
||||
{:ok, create_activity} = CommonAPI.post(user, %{"status" => "hey"})
|
||||
{:ok, favorite_activity, _} = CommonAPI.favorite(create_activity.id, other_user)
|
||||
{:ok, favorite_activity} = CommonAPI.favorite(other_user, create_activity.id)
|
||||
{:ok, reblog_activity, _} = CommonAPI.repeat(create_activity.id, other_user)
|
||||
{:ok, _, _, follow_activity} = CommonAPI.follow(other_user, user)
|
||||
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
user1 = insert(:user)
|
||||
user2 = insert(:user)
|
||||
user3 = insert(:user)
|
||||
CommonAPI.favorite(activity.id, user2)
|
||||
{:ok, _} = CommonAPI.favorite(user2, activity.id)
|
||||
{:ok, _bookmark} = Pleroma.Bookmark.create(user2.id, activity.id)
|
||||
{:ok, reblog_activity1, _object} = CommonAPI.repeat(activity.id, user1)
|
||||
{:ok, _, _object} = CommonAPI.repeat(activity.id, user2)
|
||||
|
|
@ -697,11 +697,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
activity = insert(:note_activity)
|
||||
|
||||
post(conn, "/api/v1/statuses/#{activity.id}/favourite")
|
||||
assert post(conn, "/api/v1/statuses/#{activity.id}/favourite") |> json_response(200)
|
||||
|
||||
assert post(conn, "/api/v1/statuses/#{activity.id}/favourite")
|
||||
|> json_response(200)
|
||||
end
|
||||
|
||||
test "returns 404 error for a wrong id", %{conn: conn} do
|
||||
conn = post(conn, "/api/v1/statuses/1/favourite")
|
||||
conn =
|
||||
conn
|
||||
|> post("/api/v1/statuses/1/favourite")
|
||||
|
||||
assert json_response(conn, 404) == %{"error" => "Record not found"}
|
||||
end
|
||||
|
|
@ -713,7 +717,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
test "unfavorites a status and returns it", %{user: user, conn: conn} do
|
||||
activity = insert(:note_activity)
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, user)
|
||||
{:ok, _} = CommonAPI.favorite(user, activity.id)
|
||||
|
||||
conn = post(conn, "/api/v1/statuses/#{activity.id}/unfavourite")
|
||||
|
||||
|
|
@ -1025,7 +1029,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
test "returns users who have favorited the status", %{conn: conn, activity: activity} do
|
||||
other_user = insert(:user)
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.favorite(other_user, activity.id)
|
||||
|
||||
response =
|
||||
conn
|
||||
|
|
@ -1056,7 +1060,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
other_user = insert(:user)
|
||||
{:ok, _user_relationship} = User.block(user, other_user)
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.favorite(other_user, activity.id)
|
||||
|
||||
response =
|
||||
conn
|
||||
|
|
@ -1068,7 +1072,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
test "does not fail on an unauthenticated request", %{activity: activity} do
|
||||
other_user = insert(:user)
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.favorite(other_user, activity.id)
|
||||
|
||||
response =
|
||||
build_conn()
|
||||
|
|
@ -1088,7 +1092,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
"visibility" => "direct"
|
||||
})
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.favorite(other_user, activity.id)
|
||||
|
||||
favourited_by_url = "/api/v1/statuses/#{activity.id}/favourited_by"
|
||||
|
||||
|
|
@ -1248,7 +1252,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
{:ok, _} = CommonAPI.post(other_user, %{"status" => "bla"})
|
||||
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "traps are happy"})
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, user)
|
||||
{:ok, _} = CommonAPI.favorite(user, activity.id)
|
||||
|
||||
first_conn = get(conn, "/api/v1/favourites")
|
||||
|
||||
|
|
@ -1265,7 +1269,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
"Trees Are Never Sad Look At Them Every Once In Awhile They're Quite Beautiful."
|
||||
})
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(second_activity.id, user)
|
||||
{:ok, _} = CommonAPI.favorite(user, second_activity.id)
|
||||
|
||||
last_like = status["id"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue