diff options
| author | kaniini <nenolod@gmail.com> | 2018-12-05 20:47:44 +0000 | 
|---|---|---|
| committer | kaniini <nenolod@gmail.com> | 2018-12-05 20:47:44 +0000 | 
| commit | 6ab58fdfa1ce2a4afbedb8c018b2ec617348e640 (patch) | |
| tree | c3c92fca2974539ca0f63d5e13c71b88dfc83b51 /test/web/twitter_api | |
| parent | 5f0c2372bc8be3763b649b13ee142c273583329e (diff) | |
| parent | 194869c7db1d31b139254d3a0c6a449cee0068fe (diff) | |
| download | pleroma-6ab58fdfa1ce2a4afbedb8c018b2ec617348e640.tar.gz pleroma-6ab58fdfa1ce2a4afbedb8c018b2ec617348e640.zip  | |
Merge branch 'dev_vald_fe/data_tag' into 'develop'
added data-user and data-tag attributes
Closes #410
See merge request pleroma/pleroma!504
Diffstat (limited to 'test/web/twitter_api')
| -rw-r--r-- | test/web/twitter_api/twitter_api_controller_test.exs | 4 | ||||
| -rw-r--r-- | test/web/twitter_api/twitter_api_test.exs | 6 | ||||
| -rw-r--r-- | test/web/twitter_api/views/activity_view_test.exs | 2 | 
3 files changed, 7 insertions, 5 deletions
diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index a6495ffc1..77a89ba06 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -969,7 +969,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do        assert user.name == "new name"        assert user.bio == -               "hi <span><a class='mention' href='#{user2.ap_id}'>@<span>#{user2.nickname}</span></a></span>" +               "hi <span><a data-user='#{user2.id}' class='mention' href='#{user2.ap_id}'>@<span>#{ +                 user2.nickname +               }</span></a></span>"        assert json_response(conn, 200) == UserView.render("user.json", %{user: user, for: user})      end diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index 28230699f..76de68783 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -10,7 +10,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do    test "create a status" do      user = insert(:user) -    _mentioned_user = insert(:user, %{nickname: "shp", ap_id: "shp"}) +    mentioned_user = insert(:user, %{nickname: "shp", ap_id: "shp"})      object_data = %{        "type" => "Image", @@ -35,7 +35,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do      {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)      expected_text = -      "Hello again, <span><a class='mention' href='shp'>@<span>shp</span></a></span>.<script></script><br>This is on another :moominmamma: line. <a href='http://localhost:4001/tag/2hu' rel='tag'>#2hu</a> <a href='http://localhost:4001/tag/epic' rel='tag'>#epic</a> <a href='http://localhost:4001/tag/phantasmagoric' rel='tag'>#phantasmagoric</a><br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>" +      "Hello again, <span><a data-user='#{mentioned_user.id}' class='mention' href='shp'>@<span>shp</span></a></span>.<script></script><br>This is on another :moominmamma: line. <a data-tag='2hu' href='http://localhost:4001/tag/2hu' rel='tag'>#2hu</a> <a data-tag='epic' href='http://localhost:4001/tag/epic' rel='tag'>#epic</a> <a data-tag='phantasmagoric' href='http://localhost:4001/tag/phantasmagoric' rel='tag'>#phantasmagoric</a><br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>"      assert get_in(activity.data, ["object", "content"]) == expected_text      assert get_in(activity.data, ["object", "type"]) == "Note" @@ -281,7 +281,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do      {:ok, user2} = TwitterAPI.register_user(data2)      expected_text = -      "<span><a class='mention' href='#{user1.ap_id}'>@<span>john</span></a></span> test" +      "<span><a data-user='#{user1.id}' class='mention' href='#{user1.ap_id}'>@<span>john</span></a></span> test"      assert user2.bio == expected_text    end diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs index 5cef06f88..bc36b0e90 100644 --- a/test/web/twitter_api/views/activity_view_test.exs +++ b/test/web/twitter_api/views/activity_view_test.exs @@ -47,7 +47,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do        "repeated" => false,        "statusnet_conversation_id" => convo_id,        "statusnet_html" => -        "Hey <span><a href=\"#{other_user.ap_id}\">@<span>shp</span></a></span>!", +        "Hey <span><a data-user=\"#{other_user.id}\" href=\"#{other_user.ap_id}\">@<span>shp</span></a></span>!",        "tags" => [],        "text" => "Hey @shp!",        "uri" => activity.data["object"]["id"],  | 
