Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
This commit is contained in:
commit
8e1db6a835
5 changed files with 55 additions and 22 deletions
|
|
@ -8,6 +8,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
|
|||
|
||||
use Pleroma.Web.ConnCase
|
||||
|
||||
import Mock
|
||||
import Pleroma.Factory
|
||||
|
||||
setup do: clear_config([:instance, :max_account_fields])
|
||||
|
|
@ -52,24 +53,31 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
|
|||
|
||||
user = Repo.get(User, user_data["id"])
|
||||
|
||||
res_conn =
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
|> patch("/api/v1/accounts/update_credentials", %{
|
||||
"pleroma_settings_store" => %{
|
||||
masto_fe: %{
|
||||
theme: "blub"
|
||||
clear_config([:instance, :federating], true)
|
||||
|
||||
with_mock Pleroma.Web.Federator,
|
||||
publish: fn _activity -> :ok end do
|
||||
res_conn =
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
|> patch("/api/v1/accounts/update_credentials", %{
|
||||
"pleroma_settings_store" => %{
|
||||
masto_fe: %{
|
||||
theme: "blub"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
assert user_data = json_response_and_validate_schema(res_conn, 200)
|
||||
assert user_data = json_response_and_validate_schema(res_conn, 200)
|
||||
|
||||
assert user_data["pleroma"]["settings_store"] ==
|
||||
%{
|
||||
"pleroma_fe" => %{"theme" => "bla"},
|
||||
"masto_fe" => %{"theme" => "blub"}
|
||||
}
|
||||
assert user_data["pleroma"]["settings_store"] ==
|
||||
%{
|
||||
"pleroma_fe" => %{"theme" => "bla"},
|
||||
"masto_fe" => %{"theme" => "blub"}
|
||||
}
|
||||
|
||||
assert_called(Pleroma.Web.Federator.publish(:_))
|
||||
end
|
||||
end
|
||||
|
||||
test "updates the user's bio", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
|
|||
describe "public" do
|
||||
@tag capture_log: true
|
||||
test "the public timeline", %{conn: conn} do
|
||||
following = insert(:user)
|
||||
user = insert(:user)
|
||||
|
||||
{:ok, _activity} = CommonAPI.post(following, %{status: "test"})
|
||||
{:ok, activity} = CommonAPI.post(user, %{status: "test"})
|
||||
|
||||
_activity = insert(:note_activity, local: false)
|
||||
|
||||
|
|
@ -77,6 +77,13 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
|
|||
conn = get(build_conn(), "/api/v1/timelines/public?local=1")
|
||||
|
||||
assert [%{"content" => "test"}] = json_response_and_validate_schema(conn, :ok)
|
||||
|
||||
# does not contain repeats
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, user)
|
||||
|
||||
conn = get(build_conn(), "/api/v1/timelines/public?local=true")
|
||||
|
||||
assert [_] = json_response_and_validate_schema(conn, :ok)
|
||||
end
|
||||
|
||||
test "the public timeline includes only public statuses for an authenticated user" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue