summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/twitter_api_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-12-05 21:27:56 +0100
committerlain <lain@soykaf.club>2018-12-05 21:27:56 +0100
commit76d6b1c6ab2813b1fb8f4473e4d722cc32fb2fed (patch)
tree5308f2d4c169085dfbe22a95a86c5271e4285ace /test/web/twitter_api/twitter_api_test.exs
parent3ea4476445a5e9b6ec1625d7caa537f79254e9d0 (diff)
parent5f0c2372bc8be3763b649b13ee142c273583329e (diff)
downloadpleroma-76d6b1c6ab2813b1fb8f4473e4d722cc32fb2fed.tar.gz
pleroma-76d6b1c6ab2813b1fb8f4473e4d722cc32fb2fed.zip
Merge remote-tracking branch 'origin' into follower-hiding
Diffstat (limited to 'test/web/twitter_api/twitter_api_test.exs')
-rw-r--r--test/web/twitter_api/twitter_api_test.exs29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs
index ec13b89d4..28230699f 100644
--- a/test/web/twitter_api/twitter_api_test.exs
+++ b/test/web/twitter_api/twitter_api_test.exs
@@ -257,6 +257,35 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
UserView.render("show.json", %{user: fetched_user})
end
+ test "it registers a new user and parses mentions in the bio" do
+ data1 = %{
+ "nickname" => "john",
+ "email" => "john@gmail.com",
+ "fullname" => "John Doe",
+ "bio" => "test",
+ "password" => "bear",
+ "confirm" => "bear"
+ }
+
+ {:ok, user1} = TwitterAPI.register_user(data1)
+
+ data2 = %{
+ "nickname" => "lain",
+ "email" => "lain@wired.jp",
+ "fullname" => "lain iwakura",
+ "bio" => "@john test",
+ "password" => "bear",
+ "confirm" => "bear"
+ }
+
+ {:ok, user2} = TwitterAPI.register_user(data2)
+
+ expected_text =
+ "<span><a class='mention' href='#{user1.ap_id}'>@<span>john</span></a></span> test"
+
+ assert user2.bio == expected_text
+ end
+
@moduletag skip: "needs 'registrations_open: false' in config"
test "it registers a new user via invite token and returns the user." do
{:ok, token} = UserInviteToken.create_token()