diff options
| author | feld <feld@feld.me> | 2020-04-01 17:05:09 +0000 | 
|---|---|---|
| committer | feld <feld@feld.me> | 2020-04-01 17:05:09 +0000 | 
| commit | ef7d2b0f11a9bf74e982b73ae4cec632f93fbebc (patch) | |
| tree | 2058bf1189b7a7ba12b1a160c27a9e92f3fa28bb /test/web/mastodon_api/views | |
| parent | bfec45bf740f9fcfcea92bbded6bd2c146dc64c1 (diff) | |
| parent | 1fcdcb12a717fa3dbd54a5c3778bd216df6449ad (diff) | |
| download | pleroma-ef7d2b0f11a9bf74e982b73ae4cec632f93fbebc.tar.gz pleroma-ef7d2b0f11a9bf74e982b73ae4cec632f93fbebc.zip  | |
Merge branch 'gun' into 'develop'
Gun adapter
Closes #945
See merge request pleroma/pleroma!1861
Diffstat (limited to 'test/web/mastodon_api/views')
| -rw-r--r-- | test/web/mastodon_api/views/notification_view_test.exs | 13 | ||||
| -rw-r--r-- | test/web/mastodon_api/views/status_view_test.exs | 17 | 
2 files changed, 30 insertions, 0 deletions
diff --git a/test/web/mastodon_api/views/notification_view_test.exs b/test/web/mastodon_api/views/notification_view_test.exs index 7965af00a..81eefd735 100644 --- a/test/web/mastodon_api/views/notification_view_test.exs +++ b/test/web/mastodon_api/views/notification_view_test.exs @@ -112,11 +112,24 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do      test_notifications_rendering([notification], followed, [])    end +  @tag capture_log: true    test "Move notification" do      old_user = insert(:user)      new_user = insert(:user, also_known_as: [old_user.ap_id])      follower = insert(:user) +    old_user_url = old_user.ap_id + +    body = +      File.read!("test/fixtures/users_mock/localhost.json") +      |> String.replace("{{nickname}}", old_user.nickname) +      |> Jason.encode!() + +    Tesla.Mock.mock(fn +      %{method: :get, url: ^old_user_url} -> +        %Tesla.Env{status: 200, body: body} +    end) +      User.follow(follower, old_user)      Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)      Pleroma.Tests.ObanHelpers.perform_all() diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs index 3b6571706..6791c2fb0 100644 --- a/test/web/mastodon_api/views/status_view_test.exs +++ b/test/web/mastodon_api/views/status_view_test.exs @@ -94,6 +94,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do      Repo.delete(user)      Cachex.clear(:user_cache) +    finger_url = +      "https://localhost/.well-known/webfinger?resource=acct:#{user.nickname}@localhost" + +    Tesla.Mock.mock_global(fn +      %{method: :get, url: "http://localhost/.well-known/host-meta"} -> +        %Tesla.Env{status: 404, body: ""} + +      %{method: :get, url: "https://localhost/.well-known/host-meta"} -> +        %Tesla.Env{status: 404, body: ""} + +      %{ +        method: :get, +        url: ^finger_url +      } -> +        %Tesla.Env{status: 404, body: ""} +    end) +      %{account: ms_user} = StatusView.render("show.json", activity: activity)      assert ms_user.acct == "erroruser@example.com"  | 
