diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/emoji/formatter_test.exs | 24 | ||||
| -rw-r--r-- | test/formatter_test.exs | 2 | ||||
| -rw-r--r-- | test/signature_test.exs | 13 | ||||
| -rw-r--r-- | test/user_test.exs | 66 | ||||
| -rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 1 | ||||
| -rw-r--r-- | test/web/activity_pub/publisher_test.exs | 52 | ||||
| -rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 22 | ||||
| -rw-r--r-- | test/web/activity_pub/views/user_view_test.exs | 4 | ||||
| -rw-r--r-- | test/web/common_api/common_api_test.exs | 12 | ||||
| -rw-r--r-- | test/web/common_api/common_api_utils_test.exs | 23 | ||||
| -rw-r--r-- | test/web/federator_test.exs | 4 | ||||
| -rw-r--r-- | test/web/feed/tag_controller_test.exs | 4 | ||||
| -rw-r--r-- | test/web/mastodon_api/views/account_view_test.exs | 16 | 
13 files changed, 61 insertions, 182 deletions
| diff --git a/test/emoji/formatter_test.exs b/test/emoji/formatter_test.exs index 3bfee9420..12af6cd8b 100644 --- a/test/emoji/formatter_test.exs +++ b/test/emoji/formatter_test.exs @@ -3,7 +3,6 @@  # SPDX-License-Identifier: AGPL-3.0-only  defmodule Pleroma.Emoji.FormatterTest do -  alias Pleroma.Emoji    alias Pleroma.Emoji.Formatter    use Pleroma.DataCase @@ -32,30 +31,19 @@ defmodule Pleroma.Emoji.FormatterTest do      end    end -  describe "get_emoji" do +  describe "get_emoji_map" do      test "it returns the emoji used in the text" do -      text = "I love :firefox:" - -      assert Formatter.get_emoji(text) == [ -               {"firefox", -                %Emoji{ -                  code: "firefox", -                  file: "/emoji/Firefox.gif", -                  tags: ["Gif", "Fun"], -                  safe_code: "firefox", -                  safe_file: "/emoji/Firefox.gif" -                }} -             ] +      assert Formatter.get_emoji_map("I love :firefox:") == %{ +               "firefox" => "http://localhost:4001/emoji/Firefox.gif" +             }      end      test "it returns a nice empty result when no emojis are present" do -      text = "I love moominamma" -      assert Formatter.get_emoji(text) == [] +      assert Formatter.get_emoji_map("I love moominamma") == %{}      end      test "it doesn't die when text is absent" do -      text = nil -      assert Formatter.get_emoji(text) == [] +      assert Formatter.get_emoji_map(nil) == %{}      end    end  end diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 93fd8eab7..bef5a2c28 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -140,7 +140,7 @@ defmodule Pleroma.FormatterTest do        archaeme =          insert(:user,            nickname: "archa_eme_", -          source_data: %{"url" => "https://archeme/@archa_eme_"} +          uri: "https://archeme/@archa_eme_"          )        archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"}) diff --git a/test/signature_test.exs b/test/signature_test.exs index 04736d8b9..d5a2a62c4 100644 --- a/test/signature_test.exs +++ b/test/signature_test.exs @@ -19,12 +19,7 @@ defmodule Pleroma.SignatureTest do    @private_key "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEA48qb4v6kqigZutO9Ot0wkp27GIF2LiVaADgxQORZozZR63jH\nTaoOrS3Xhngbgc8SSOhfXET3omzeCLqaLNfXnZ8OXmuhJfJSU6mPUvmZ9QdT332j\nfN/g3iWGhYMf/M9ftCKh96nvFVO/tMruzS9xx7tkrfJjehdxh/3LlJMMImPtwcD7\nkFXwyt1qZTAU6Si4oQAJxRDQXHp1ttLl3Ob829VM7IKkrVmY8TD+JSlV0jtVJPj6\n1J19ytKTx/7UaucYvb9HIiBpkuiy5n/irDqKLVf5QEdZoNCdojOZlKJmTLqHhzKP\n3E9TxsUjhrf4/EqegNc/j982RvOxeu4i40zMQwIDAQABAoIBAQDH5DXjfh21i7b4\ncXJuw0cqget617CDUhemdakTDs9yH+rHPZd3mbGDWuT0hVVuFe4vuGpmJ8c+61X0\nRvugOlBlavxK8xvYlsqTzAmPgKUPljyNtEzQ+gz0I+3mH2jkin2rL3D+SksZZgKm\nfiYMPIQWB2WUF04gB46DDb2mRVuymGHyBOQjIx3WC0KW2mzfoFUFRlZEF+Nt8Ilw\nT+g/u0aZ1IWoszbsVFOEdghgZET0HEarum0B2Je/ozcPYtwmU10iBANGMKdLqaP/\nj954BPunrUf6gmlnLZKIKklJj0advx0NA+cL79+zeVB3zexRYSA5o9q0WPhiuTwR\n/aedWHnBAoGBAP0sDWBAM1Y4TRAf8ZI9PcztwLyHPzfEIqzbObJJnx1icUMt7BWi\n+/RMOnhrlPGE1kMhOqSxvXYN3u+eSmWTqai2sSH5Hdw2EqnrISSTnwNUPINX7fHH\njEkgmXQ6ixE48SuBZnb4w1EjdB/BA6/sjL+FNhggOc87tizLTkMXmMtTAoGBAOZV\n+wPuAMBDBXmbmxCuDIjoVmgSlgeRunB1SA8RCPAFAiUo3+/zEgzW2Oz8kgI+xVwM\n33XkLKrWG1Orhpp6Hm57MjIc5MG+zF4/YRDpE/KNG9qU1tiz0UD5hOpIU9pP4bR/\ngxgPxZzvbk4h5BfHWLpjlk8UUpgk6uxqfti48c1RAoGBALBOKDZ6HwYRCSGMjUcg\n3NPEUi84JD8qmFc2B7Tv7h2he2ykIz9iFAGpwCIyETQsJKX1Ewi0OlNnD3RhEEAy\nl7jFGQ+mkzPSeCbadmcpYlgIJmf1KN/x7fDTAepeBpCEzfZVE80QKbxsaybd3Dp8\nCfwpwWUFtBxr4c7J+gNhAGe/AoGAPn8ZyqkrPv9wXtyfqFjxQbx4pWhVmNwrkBPi\nZ2Qh3q4dNOPwTvTO8vjghvzIyR8rAZzkjOJKVFgftgYWUZfM5gE7T2mTkBYq8W+U\n8LetF+S9qAM2gDnaDx0kuUTCq7t87DKk6URuQ/SbI0wCzYjjRD99KxvChVGPBHKo\n1DjqMuECgYEAgJGNm7/lJCS2wk81whfy/ttKGsEIkyhPFYQmdGzSYC5aDc2gp1R3\nxtOkYEvdjfaLfDGEa4UX8CHHF+w3t9u8hBtcdhMH6GYb9iv6z0VBTt4A/11HUR49\n3Z7TQ18Iyh3jAUCzFV9IJlLIExq5Y7P4B3ojWFBN607sDCt8BMPbDYs=\n-----END RSA PRIVATE KEY-----" -  @public_key %{ -    "id" => "https://mastodon.social/users/lambadalambda#main-key", -    "owner" => "https://mastodon.social/users/lambadalambda", -    "publicKeyPem" => -      "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw0P/Tq4gb4G/QVuMGbJo\nC/AfMNcv+m7NfrlOwkVzcU47jgESuYI4UtJayissCdBycHUnfVUd9qol+eznSODz\nCJhfJloqEIC+aSnuEPGA0POtWad6DU0E6/Ho5zQn5WAWUwbRQqowbrsm/GHo2+3v\neR5jGenwA6sYhINg/c3QQbksyV0uJ20Umyx88w8+TJuv53twOfmyDWuYNoQ3y5cc\nHKOZcLHxYOhvwg3PFaGfFHMFiNmF40dTXt9K96r7sbzc44iLD+VphbMPJEjkMuf8\nPGEFOBzy8pm3wJZw2v32RNW2VESwMYyqDzwHXGSq1a73cS7hEnc79gXlELsK04L9\nQQIDAQAB\n-----END PUBLIC KEY-----\n" -  } +  @public_key "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw0P/Tq4gb4G/QVuMGbJo\nC/AfMNcv+m7NfrlOwkVzcU47jgESuYI4UtJayissCdBycHUnfVUd9qol+eznSODz\nCJhfJloqEIC+aSnuEPGA0POtWad6DU0E6/Ho5zQn5WAWUwbRQqowbrsm/GHo2+3v\neR5jGenwA6sYhINg/c3QQbksyV0uJ20Umyx88w8+TJuv53twOfmyDWuYNoQ3y5cc\nHKOZcLHxYOhvwg3PFaGfFHMFiNmF40dTXt9K96r7sbzc44iLD+VphbMPJEjkMuf8\nPGEFOBzy8pm3wJZw2v32RNW2VESwMYyqDzwHXGSq1a73cS7hEnc79gXlELsK04L9\nQQIDAQAB\n-----END PUBLIC KEY-----\n"    @rsa_public_key {      :RSAPublicKey, @@ -42,7 +37,7 @@ defmodule Pleroma.SignatureTest do      test "it returns key" do        expected_result = {:ok, @rsa_public_key} -      user = insert(:user, source_data: %{"publicKey" => @public_key}) +      user = insert(:user, public_key: @public_key)        assert Signature.fetch_public_key(make_fake_conn(user.ap_id)) == expected_result      end @@ -53,8 +48,8 @@ defmodule Pleroma.SignatureTest do               end) =~ "[error] Could not decode user"      end -    test "it returns error if public key is empty" do -      user = insert(:user, source_data: %{"publicKey" => %{}}) +    test "it returns error if public key is nil" do +      user = insert(:user, public_key: nil)        assert Signature.fetch_public_key(make_fake_conn(user.ap_id)) == {:error, :error}      end diff --git a/test/user_test.exs b/test/user_test.exs index a00b1b5e2..65e118d6d 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -582,7 +582,7 @@ defmodule Pleroma.UserTest do        {:ok, user} = User.get_or_fetch_by_ap_id("http://mastodon.example.org/users/admin") -      assert user.source_data["endpoints"] +      assert user.inbox        refute user.last_refreshed_at == orig_user.last_refreshed_at      end @@ -610,7 +610,7 @@ defmodule Pleroma.UserTest do               ) <> "/followers"    end -  describe "remote user creation changeset" do +  describe "remote user changeset" do      @valid_remote %{        bio: "hello",        name: "Someone", @@ -622,28 +622,28 @@ defmodule Pleroma.UserTest do      setup do: clear_config([:instance, :user_name_length])      test "it confirms validity" do -      cs = User.remote_user_creation(@valid_remote) +      cs = User.remote_user_changeset(@valid_remote)        assert cs.valid?      end      test "it sets the follower_adress" do -      cs = User.remote_user_creation(@valid_remote) +      cs = User.remote_user_changeset(@valid_remote)        # remote users get a fake local follower address        assert cs.changes.follower_address ==                 User.ap_followers(%User{nickname: @valid_remote[:nickname]})      end      test "it enforces the fqn format for nicknames" do -      cs = User.remote_user_creation(%{@valid_remote | nickname: "bla"}) +      cs = User.remote_user_changeset(%{@valid_remote | nickname: "bla"})        assert Ecto.Changeset.get_field(cs, :local) == false        assert cs.changes.avatar        refute cs.valid?      end      test "it has required fields" do -      [:name, :ap_id] +      [:ap_id]        |> Enum.each(fn field -> -        cs = User.remote_user_creation(Map.delete(@valid_remote, field)) +        cs = User.remote_user_changeset(Map.delete(@valid_remote, field))          refute cs.valid?        end)      end @@ -1199,58 +1199,6 @@ defmodule Pleroma.UserTest do      assert {:ok, _key} = User.get_public_key_for_ap_id("http://mastodon.example.org/users/admin")    end -  describe "insert or update a user from given data" do -    test "with normal data" do -      user = insert(:user, %{nickname: "nick@name.de"}) -      data = %{ap_id: user.ap_id <> "xxx", name: user.name, nickname: user.nickname} - -      assert {:ok, %User{}} = User.insert_or_update_user(data) -    end - -    test "with overly long fields" do -      current_max_length = Pleroma.Config.get([:instance, :account_field_value_length], 255) -      user = insert(:user, nickname: "nickname@supergood.domain") - -      data = %{ -        ap_id: user.ap_id, -        name: user.name, -        nickname: user.nickname, -        fields: [ -          %{"name" => "myfield", "value" => String.duplicate("h", current_max_length + 1)} -        ] -      } - -      assert {:ok, %User{}} = User.insert_or_update_user(data) -    end - -    test "with an overly long bio" do -      current_max_length = Pleroma.Config.get([:instance, :user_bio_length], 5000) -      user = insert(:user, nickname: "nickname@supergood.domain") - -      data = %{ -        ap_id: user.ap_id, -        name: user.name, -        nickname: user.nickname, -        bio: String.duplicate("h", current_max_length + 1) -      } - -      assert {:ok, %User{}} = User.insert_or_update_user(data) -    end - -    test "with an overly long display name" do -      current_max_length = Pleroma.Config.get([:instance, :user_name_length], 100) -      user = insert(:user, nickname: "nickname@supergood.domain") - -      data = %{ -        ap_id: user.ap_id, -        name: String.duplicate("h", current_max_length + 1), -        nickname: user.nickname -      } - -      assert {:ok, %User{}} = User.insert_or_update_user(data) -    end -  end -    describe "per-user rich-text filtering" do      test "html_filter_policy returns default policies, when rich-text is enabled" do        user = insert(:user) diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index 17e7b97de..6410df49b 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -180,7 +180,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do        {:ok, user} = ActivityPub.make_user_from_ap_id(user_id)        assert user.ap_id == user_id        assert user.nickname == "admin@mastodon.example.org" -      assert user.source_data        assert user.ap_enabled        assert user.follower_address == "http://mastodon.example.org/users/admin/followers"      end diff --git a/test/web/activity_pub/publisher_test.exs b/test/web/activity_pub/publisher_test.exs index 801da03c1..c2bc38d52 100644 --- a/test/web/activity_pub/publisher_test.exs +++ b/test/web/activity_pub/publisher_test.exs @@ -48,10 +48,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do    describe "determine_inbox/2" do      test "it returns sharedInbox for messages involving as:Public in to" do -      user = -        insert(:user, %{ -          source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}} -        }) +      user = insert(:user, %{shared_inbox: "http://example.com/inbox"})        activity = %Activity{          data: %{"to" => [@as_public], "cc" => [user.follower_address]} @@ -61,10 +58,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do      end      test "it returns sharedInbox for messages involving as:Public in cc" do -      user = -        insert(:user, %{ -          source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}} -        }) +      user = insert(:user, %{shared_inbox: "http://example.com/inbox"})        activity = %Activity{          data: %{"cc" => [@as_public], "to" => [user.follower_address]} @@ -74,11 +68,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do      end      test "it returns sharedInbox for messages involving multiple recipients in to" do -      user = -        insert(:user, %{ -          source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}} -        }) - +      user = insert(:user, %{shared_inbox: "http://example.com/inbox"})        user_two = insert(:user)        user_three = insert(:user) @@ -90,11 +80,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do      end      test "it returns sharedInbox for messages involving multiple recipients in cc" do -      user = -        insert(:user, %{ -          source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}} -        }) - +      user = insert(:user, %{shared_inbox: "http://example.com/inbox"})        user_two = insert(:user)        user_three = insert(:user) @@ -107,12 +93,10 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do      test "it returns sharedInbox for messages involving multiple recipients in total" do        user = -        insert(:user, -          source_data: %{ -            "inbox" => "http://example.com/personal-inbox", -            "endpoints" => %{"sharedInbox" => "http://example.com/inbox"} -          } -        ) +        insert(:user, %{ +          shared_inbox: "http://example.com/inbox", +          inbox: "http://example.com/personal-inbox" +        })        user_two = insert(:user) @@ -125,12 +109,10 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do      test "it returns inbox for messages involving single recipients in total" do        user = -        insert(:user, -          source_data: %{ -            "inbox" => "http://example.com/personal-inbox", -            "endpoints" => %{"sharedInbox" => "http://example.com/inbox"} -          } -        ) +        insert(:user, %{ +          shared_inbox: "http://example.com/inbox", +          inbox: "http://example.com/personal-inbox" +        })        activity = %Activity{          data: %{"to" => [user.ap_id], "cc" => []} @@ -258,11 +240,11 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do                     [:passthrough],                     [] do        follower = -        insert(:user, +        insert(:user, %{            local: false, -          source_data: %{"inbox" => "https://domain.com/users/nick1/inbox"}, +          inbox: "https://domain.com/users/nick1/inbox",            ap_enabled: true -        ) +        })        actor = insert(:user, follower_address: follower.ap_id)        user = insert(:user) @@ -295,14 +277,14 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do        fetcher =          insert(:user,            local: false, -          source_data: %{"inbox" => "https://domain.com/users/nick1/inbox"}, +          inbox: "https://domain.com/users/nick1/inbox",            ap_enabled: true          )        another_fetcher =          insert(:user,            local: false, -          source_data: %{"inbox" => "https://domain2.com/users/nick1/inbox"}, +          inbox: "https://domain2.com/users/nick1/inbox",            ap_enabled: true          ) diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 2332029e5..6057e360a 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -746,7 +746,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do        user = User.get_cached_by_ap_id(activity.actor) -      assert User.fields(user) == [ +      assert user.fields == [                 %{"name" => "foo", "value" => "bar"},                 %{"name" => "foo1", "value" => "bar1"}               ] @@ -767,7 +767,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do        user = User.get_cached_by_ap_id(user.ap_id) -      assert User.fields(user) == [ +      assert user.fields == [                 %{"name" => "foo", "value" => "updated"},                 %{"name" => "foo1", "value" => "updated"}               ] @@ -785,7 +785,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do        user = User.get_cached_by_ap_id(user.ap_id) -      assert User.fields(user) == [ +      assert user.fields == [                 %{"name" => "foo", "value" => "updated"},                 %{"name" => "foo1", "value" => "updated"}               ] @@ -796,7 +796,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do        user = User.get_cached_by_ap_id(user.ap_id) -      assert User.fields(user) == [] +      assert user.fields == []      end      test "it works for incoming update activities which lock the account" do @@ -2162,4 +2162,18 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do                 Transmogrifier.set_replies(object.data)["replies"]      end    end + +  test "take_emoji_tags/1" do +    user = insert(:user, %{emoji: %{"firefox" => "https://example.org/firefox.png"}}) + +    assert Transmogrifier.take_emoji_tags(user) == [ +             %{ +               "icon" => %{"type" => "Image", "url" => "https://example.org/firefox.png"}, +               "id" => "https://example.org/firefox.png", +               "name" => ":firefox:", +               "type" => "Emoji", +               "updated" => "1970-01-01T00:00:00Z" +             } +           ] +  end  end diff --git a/test/web/activity_pub/views/user_view_test.exs b/test/web/activity_pub/views/user_view_test.exs index ecb2dc386..8d00893a5 100644 --- a/test/web/activity_pub/views/user_view_test.exs +++ b/test/web/activity_pub/views/user_view_test.exs @@ -29,7 +29,7 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do      {:ok, user} =        insert(:user) -      |> User.upgrade_changeset(%{fields: fields}) +      |> User.update_changeset(%{fields: fields})        |> User.update_and_set_cache()      assert %{ @@ -38,7 +38,7 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do    end    test "Renders with emoji tags" do -    user = insert(:user, emoji: [%{"bib" => "/test"}]) +    user = insert(:user, emoji: %{"bib" => "/test"})      assert %{               "tag" => [ diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index b12be973f..e130736ec 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -97,18 +97,6 @@ defmodule Pleroma.Web.CommonAPITest do      assert Object.normalize(activity).data["emoji"]["firefox"]    end -  test "it adds emoji when updating profiles" do -    user = insert(:user, %{name: ":firefox:"}) - -    {:ok, activity} = CommonAPI.update(user) -    user = User.get_cached_by_ap_id(user.ap_id) -    [firefox] = user.source_data["tag"] - -    assert firefox["name"] == ":firefox:" - -    assert Pleroma.Constants.as_public() in activity.recipients -  end -    describe "posting" do      test "it supports explicit addressing" do        user = insert(:user) diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs index 98cf02d49..b21445fe9 100644 --- a/test/web/common_api/common_api_utils_test.exs +++ b/test/web/common_api/common_api_utils_test.exs @@ -7,7 +7,6 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do    alias Pleroma.Object    alias Pleroma.Web.CommonAPI    alias Pleroma.Web.CommonAPI.Utils -  alias Pleroma.Web.Endpoint    use Pleroma.DataCase    import ExUnit.CaptureLog @@ -42,28 +41,6 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do      end    end -  test "parses emoji from name and bio" do -    {:ok, user} = UserBuilder.insert(%{name: ":blank:", bio: ":firefox:"}) - -    expected = [ -      %{ -        "type" => "Emoji", -        "icon" => %{"type" => "Image", "url" => "#{Endpoint.url()}/emoji/Firefox.gif"}, -        "name" => ":firefox:" -      }, -      %{ -        "type" => "Emoji", -        "icon" => %{ -          "type" => "Image", -          "url" => "#{Endpoint.url()}/emoji/blank.png" -        }, -        "name" => ":blank:" -      } -    ] - -    assert expected == Utils.emoji_from_profile(user) -  end -    describe "format_input/3" do      test "works for bare text/plain" do        text = "hello world!" diff --git a/test/web/federator_test.exs b/test/web/federator_test.exs index da844c24c..59e53bb03 100644 --- a/test/web/federator_test.exs +++ b/test/web/federator_test.exs @@ -78,7 +78,7 @@ defmodule Pleroma.Web.FederatorTest do          local: false,          nickname: "nick1@domain.com",          ap_id: "https://domain.com/users/nick1", -        source_data: %{"inbox" => inbox1}, +        inbox: inbox1,          ap_enabled: true        }) @@ -86,7 +86,7 @@ defmodule Pleroma.Web.FederatorTest do          local: false,          nickname: "nick2@domain2.com",          ap_id: "https://domain2.com/users/nick2", -        source_data: %{"inbox" => inbox2}, +        inbox: inbox2,          ap_enabled: true        }) diff --git a/test/web/feed/tag_controller_test.exs b/test/web/feed/tag_controller_test.exs index e863df86b..d95aac108 100644 --- a/test/web/feed/tag_controller_test.exs +++ b/test/web/feed/tag_controller_test.exs @@ -150,8 +150,8 @@ defmodule Pleroma.Web.Feed.TagControllerTest do      obj2 = Object.normalize(activity2)      assert xpath(xml, ~x"//channel/item/description/text()"sl) == [ -             HtmlEntities.decode(FeedView.activity_content(obj2)), -             HtmlEntities.decode(FeedView.activity_content(obj1)) +             HtmlEntities.decode(FeedView.activity_content(obj2.data)), +             HtmlEntities.decode(FeedView.activity_content(obj1.data))             ]      response = diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs index 4435f69ff..85fa4f6a2 100644 --- a/test/web/mastodon_api/views/account_view_test.exs +++ b/test/web/mastodon_api/views/account_view_test.exs @@ -19,16 +19,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do    end    test "Represent a user account" do -    source_data = %{ -      "tag" => [ -        %{ -          "type" => "Emoji", -          "icon" => %{"url" => "/file.png"}, -          "name" => ":karjalanpiirakka:" -        } -      ] -    } -      background_image = %{        "url" => [%{"href" => "https://example.com/images/asuka_hospital.png"}]      } @@ -37,13 +27,13 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do        insert(:user, %{          follower_count: 3,          note_count: 5, -        source_data: source_data,          background: background_image,          nickname: "shp@shitposter.club",          name: ":karjalanpiirakka: shp",          bio:            "<script src=\"invalid-html\"></script><span>valid html</span>. a<br>b<br/>c<br >d<br />f", -        inserted_at: ~N[2017-08-15 15:47:06.597036] +        inserted_at: ~N[2017-08-15 15:47:06.597036], +        emoji: %{"karjalanpiirakka" => "/file.png"}        })      expected = %{ @@ -117,7 +107,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do        insert(:user, %{          follower_count: 3,          note_count: 5, -        source_data: %{},          actor_type: "Service",          nickname: "shp@shitposter.club",          inserted_at: ~N[2017-08-15 15:47:06.597036] @@ -311,7 +300,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do        insert(:user, %{          follower_count: 0,          note_count: 5, -        source_data: %{},          actor_type: "Service",          nickname: "shp@shitposter.club",          inserted_at: ~N[2017-08-15 15:47:06.597036] | 
