Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/digest...
[akkoma] / test / web / twitter_api / twitter_api_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
6 use Pleroma.DataCase
7 alias Pleroma.Activity
8 alias Pleroma.Object
9 alias Pleroma.Repo
10 alias Pleroma.User
11 alias Pleroma.UserInviteToken
12 alias Pleroma.Web.ActivityPub.ActivityPub
13 alias Pleroma.Web.TwitterAPI.ActivityView
14 alias Pleroma.Web.TwitterAPI.TwitterAPI
15 alias Pleroma.Web.TwitterAPI.UserView
16
17 import Pleroma.Factory
18
19 setup_all do
20 Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
21 :ok
22 end
23
24 test "create a status" do
25 user = insert(:user)
26 mentioned_user = insert(:user, %{nickname: "shp", ap_id: "shp"})
27
28 object_data = %{
29 "type" => "Image",
30 "url" => [
31 %{
32 "type" => "Link",
33 "mediaType" => "image/jpg",
34 "href" => "http://example.org/image.jpg"
35 }
36 ],
37 "uuid" => 1
38 }
39
40 object = Repo.insert!(%Object{data: object_data})
41
42 input = %{
43 "status" =>
44 "Hello again, @shp.<script></script>\nThis is on another :moominmamma: line. #2hu #epic #phantasmagoric",
45 "media_ids" => [object.id]
46 }
47
48 {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
49
50 expected_text =
51 "Hello again, <span class='h-card'><a data-user='#{mentioned_user.id}' class='u-url mention' href='shp'>@<span>shp</span></a></span>.&lt;script&gt;&lt;/script&gt;<br>This is on another :moominmamma: line. <a class='hashtag' data-tag='2hu' href='http://localhost:4001/tag/2hu' rel='tag'>#2hu</a> <a class='hashtag' data-tag='epic' href='http://localhost:4001/tag/epic' rel='tag'>#epic</a> <a class='hashtag' 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>"
52
53 assert get_in(activity.data, ["object", "content"]) == expected_text
54 assert get_in(activity.data, ["object", "type"]) == "Note"
55 assert get_in(activity.data, ["object", "actor"]) == user.ap_id
56 assert get_in(activity.data, ["actor"]) == user.ap_id
57 assert Enum.member?(get_in(activity.data, ["cc"]), User.ap_followers(user))
58
59 assert Enum.member?(
60 get_in(activity.data, ["to"]),
61 "https://www.w3.org/ns/activitystreams#Public"
62 )
63
64 assert Enum.member?(get_in(activity.data, ["to"]), "shp")
65 assert activity.local == true
66
67 assert %{"moominmamma" => "http://localhost:4001/finmoji/128px/moominmamma-128.png"} =
68 activity.data["object"]["emoji"]
69
70 # hashtags
71 assert activity.data["object"]["tag"] == ["2hu", "epic", "phantasmagoric"]
72
73 # Add a context
74 assert is_binary(get_in(activity.data, ["context"]))
75 assert is_binary(get_in(activity.data, ["object", "context"]))
76
77 assert is_list(activity.data["object"]["attachment"])
78
79 assert activity.data["object"] == Object.get_by_ap_id(activity.data["object"]["id"]).data
80
81 user = User.get_by_ap_id(user.ap_id)
82
83 assert user.info.note_count == 1
84 end
85
86 test "create a status that is a reply" do
87 user = insert(:user)
88
89 input = %{
90 "status" => "Hello again."
91 }
92
93 {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
94
95 input = %{
96 "status" => "Here's your (you).",
97 "in_reply_to_status_id" => activity.id
98 }
99
100 {:ok, reply = %Activity{}} = TwitterAPI.create_status(user, input)
101
102 assert get_in(reply.data, ["context"]) == get_in(activity.data, ["context"])
103
104 assert get_in(reply.data, ["object", "context"]) ==
105 get_in(activity.data, ["object", "context"])
106
107 assert get_in(reply.data, ["object", "inReplyTo"]) == get_in(activity.data, ["object", "id"])
108 assert Activity.get_in_reply_to_activity(reply).id == activity.id
109 end
110
111 test "Follow another user using user_id" do
112 user = insert(:user)
113 followed = insert(:user)
114
115 {:ok, user, followed, _activity} = TwitterAPI.follow(user, %{"user_id" => followed.id})
116 assert User.ap_followers(followed) in user.following
117
118 {:error, msg} = TwitterAPI.follow(user, %{"user_id" => followed.id})
119 assert msg == "Could not follow user: #{followed.nickname} is already on your list."
120 end
121
122 test "Follow another user using screen_name" do
123 user = insert(:user)
124 followed = insert(:user)
125
126 {:ok, user, followed, _activity} =
127 TwitterAPI.follow(user, %{"screen_name" => followed.nickname})
128
129 assert User.ap_followers(followed) in user.following
130
131 followed = User.get_by_ap_id(followed.ap_id)
132 assert followed.info.follower_count == 1
133
134 {:error, msg} = TwitterAPI.follow(user, %{"screen_name" => followed.nickname})
135 assert msg == "Could not follow user: #{followed.nickname} is already on your list."
136 end
137
138 test "Unfollow another user using user_id" do
139 unfollowed = insert(:user)
140 user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
141 ActivityPub.follow(user, unfollowed)
142
143 {:ok, user, unfollowed} = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
144 assert user.following == []
145
146 {:error, msg} = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
147 assert msg == "Not subscribed!"
148 end
149
150 test "Unfollow another user using screen_name" do
151 unfollowed = insert(:user)
152 user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
153
154 ActivityPub.follow(user, unfollowed)
155
156 {:ok, user, unfollowed} = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
157 assert user.following == []
158
159 {:error, msg} = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
160 assert msg == "Not subscribed!"
161 end
162
163 test "Block another user using user_id" do
164 user = insert(:user)
165 blocked = insert(:user)
166
167 {:ok, user, blocked} = TwitterAPI.block(user, %{"user_id" => blocked.id})
168 assert User.blocks?(user, blocked)
169 end
170
171 test "Block another user using screen_name" do
172 user = insert(:user)
173 blocked = insert(:user)
174
175 {:ok, user, blocked} = TwitterAPI.block(user, %{"screen_name" => blocked.nickname})
176 assert User.blocks?(user, blocked)
177 end
178
179 test "Unblock another user using user_id" do
180 unblocked = insert(:user)
181 user = insert(:user)
182 {:ok, user, _unblocked} = TwitterAPI.block(user, %{"user_id" => unblocked.id})
183
184 {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"user_id" => unblocked.id})
185 assert user.info.blocks == []
186 end
187
188 test "Unblock another user using screen_name" do
189 unblocked = insert(:user)
190 user = insert(:user)
191 {:ok, user, _unblocked} = TwitterAPI.block(user, %{"screen_name" => unblocked.nickname})
192
193 {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"screen_name" => unblocked.nickname})
194 assert user.info.blocks == []
195 end
196
197 test "upload a file" do
198 user = insert(:user)
199
200 file = %Plug.Upload{
201 content_type: "image/jpg",
202 path: Path.absname("test/fixtures/image.jpg"),
203 filename: "an_image.jpg"
204 }
205
206 response = TwitterAPI.upload(file, user)
207
208 assert is_binary(response)
209 end
210
211 test "it favorites a status, returns the updated activity" do
212 user = insert(:user)
213 other_user = insert(:user)
214 note_activity = insert(:note_activity)
215
216 {:ok, status} = TwitterAPI.fav(user, note_activity.id)
217 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
218 assert ActivityView.render("activity.json", %{activity: updated_activity})["fave_num"] == 1
219
220 object = Object.normalize(note_activity.data["object"])
221
222 assert object.data["like_count"] == 1
223
224 assert status == updated_activity
225
226 {:ok, _status} = TwitterAPI.fav(other_user, note_activity.id)
227
228 object = Object.normalize(note_activity.data["object"])
229
230 assert object.data["like_count"] == 2
231
232 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
233 assert ActivityView.render("activity.json", %{activity: updated_activity})["fave_num"] == 2
234 end
235
236 test "it unfavorites a status, returns the updated activity" do
237 user = insert(:user)
238 note_activity = insert(:note_activity)
239 object = Object.get_by_ap_id(note_activity.data["object"]["id"])
240
241 {:ok, _like_activity, _object} = ActivityPub.like(user, object)
242 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
243
244 assert ActivityView.render("activity.json", activity: updated_activity)["fave_num"] == 1
245
246 {:ok, activity} = TwitterAPI.unfav(user, note_activity.id)
247
248 assert ActivityView.render("activity.json", activity: activity)["fave_num"] == 0
249 end
250
251 test "it retweets a status and returns the retweet" do
252 user = insert(:user)
253 note_activity = insert(:note_activity)
254
255 {:ok, status} = TwitterAPI.repeat(user, note_activity.id)
256 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
257
258 assert status == updated_activity
259 end
260
261 test "it unretweets an already retweeted status" do
262 user = insert(:user)
263 note_activity = insert(:note_activity)
264
265 {:ok, _status} = TwitterAPI.repeat(user, note_activity.id)
266 {:ok, status} = TwitterAPI.unrepeat(user, note_activity.id)
267 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
268
269 assert status == updated_activity
270 end
271
272 test "it registers a new user and returns the user." do
273 data = %{
274 "nickname" => "lain",
275 "email" => "lain@wired.jp",
276 "fullname" => "lain iwakura",
277 "password" => "bear",
278 "confirm" => "bear"
279 }
280
281 {:ok, user} = TwitterAPI.register_user(data)
282
283 fetched_user = User.get_by_nickname("lain")
284
285 assert UserView.render("show.json", %{user: user}) ==
286 UserView.render("show.json", %{user: fetched_user})
287 end
288
289 test "it registers a new user with empty string in bio and returns the user." do
290 data = %{
291 "nickname" => "lain",
292 "email" => "lain@wired.jp",
293 "fullname" => "lain iwakura",
294 "bio" => "",
295 "password" => "bear",
296 "confirm" => "bear"
297 }
298
299 {:ok, user} = TwitterAPI.register_user(data)
300
301 fetched_user = User.get_by_nickname("lain")
302
303 assert UserView.render("show.json", %{user: user}) ==
304 UserView.render("show.json", %{user: fetched_user})
305 end
306
307 test "it sends confirmation email if :account_activation_required is specified in instance config" do
308 setting = Pleroma.Config.get([:instance, :account_activation_required])
309
310 unless setting do
311 Pleroma.Config.put([:instance, :account_activation_required], true)
312 on_exit(fn -> Pleroma.Config.put([:instance, :account_activation_required], setting) end)
313 end
314
315 data = %{
316 "nickname" => "lain",
317 "email" => "lain@wired.jp",
318 "fullname" => "lain iwakura",
319 "bio" => "",
320 "password" => "bear",
321 "confirm" => "bear"
322 }
323
324 {:ok, user} = TwitterAPI.register_user(data)
325
326 assert user.info.confirmation_pending
327
328 email = Pleroma.Emails.UserEmail.account_confirmation_email(user)
329
330 notify_email = Pleroma.Config.get([:instance, :notify_email])
331 instance_name = Pleroma.Config.get([:instance, :name])
332
333 Swoosh.TestAssertions.assert_email_sent(
334 from: {instance_name, notify_email},
335 to: {user.name, user.email},
336 html_body: email.html_body
337 )
338 end
339
340 test "it registers a new user and parses mentions in the bio" do
341 data1 = %{
342 "nickname" => "john",
343 "email" => "john@gmail.com",
344 "fullname" => "John Doe",
345 "bio" => "test",
346 "password" => "bear",
347 "confirm" => "bear"
348 }
349
350 {:ok, user1} = TwitterAPI.register_user(data1)
351
352 data2 = %{
353 "nickname" => "lain",
354 "email" => "lain@wired.jp",
355 "fullname" => "lain iwakura",
356 "bio" => "@john test",
357 "password" => "bear",
358 "confirm" => "bear"
359 }
360
361 {:ok, user2} = TwitterAPI.register_user(data2)
362
363 expected_text =
364 "<span class='h-card'><a data-user='#{user1.id}' class='u-url mention' href='#{user1.ap_id}'>@<span>john</span></a></span> test"
365
366 assert user2.bio == expected_text
367 end
368
369 describe "register with one time token" do
370 setup do
371 setting = Pleroma.Config.get([:instance, :registrations_open])
372
373 if setting do
374 Pleroma.Config.put([:instance, :registrations_open], false)
375 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
376 end
377
378 :ok
379 end
380
381 test "returns user on success" do
382 {:ok, invite} = UserInviteToken.create_invite()
383
384 data = %{
385 "nickname" => "vinny",
386 "email" => "pasta@pizza.vs",
387 "fullname" => "Vinny Vinesauce",
388 "bio" => "streamer",
389 "password" => "hiptofbees",
390 "confirm" => "hiptofbees",
391 "token" => invite.token
392 }
393
394 {:ok, user} = TwitterAPI.register_user(data)
395
396 fetched_user = User.get_by_nickname("vinny")
397 invite = Repo.get_by(UserInviteToken, token: invite.token)
398
399 assert invite.used == true
400
401 assert UserView.render("show.json", %{user: user}) ==
402 UserView.render("show.json", %{user: fetched_user})
403 end
404
405 test "returns error on invalid token" do
406 data = %{
407 "nickname" => "GrimReaper",
408 "email" => "death@reapers.afterlife",
409 "fullname" => "Reaper Grim",
410 "bio" => "Your time has come",
411 "password" => "scythe",
412 "confirm" => "scythe",
413 "token" => "DudeLetMeInImAFairy"
414 }
415
416 {:error, msg} = TwitterAPI.register_user(data)
417
418 assert msg == "Invalid token"
419 refute User.get_by_nickname("GrimReaper")
420 end
421
422 test "returns error on expired token" do
423 {:ok, invite} = UserInviteToken.create_invite()
424 UserInviteToken.update_invite!(invite, used: true)
425
426 data = %{
427 "nickname" => "GrimReaper",
428 "email" => "death@reapers.afterlife",
429 "fullname" => "Reaper Grim",
430 "bio" => "Your time has come",
431 "password" => "scythe",
432 "confirm" => "scythe",
433 "token" => invite.token
434 }
435
436 {:error, msg} = TwitterAPI.register_user(data)
437
438 assert msg == "Expired token"
439 refute User.get_by_nickname("GrimReaper")
440 end
441 end
442
443 describe "registers with date limited token" do
444 setup do
445 setting = Pleroma.Config.get([:instance, :registrations_open])
446
447 if setting do
448 Pleroma.Config.put([:instance, :registrations_open], false)
449 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
450 end
451
452 data = %{
453 "nickname" => "vinny",
454 "email" => "pasta@pizza.vs",
455 "fullname" => "Vinny Vinesauce",
456 "bio" => "streamer",
457 "password" => "hiptofbees",
458 "confirm" => "hiptofbees"
459 }
460
461 check_fn = fn invite ->
462 data = Map.put(data, "token", invite.token)
463 {:ok, user} = TwitterAPI.register_user(data)
464 fetched_user = User.get_by_nickname("vinny")
465
466 assert UserView.render("show.json", %{user: user}) ==
467 UserView.render("show.json", %{user: fetched_user})
468 end
469
470 {:ok, data: data, check_fn: check_fn}
471 end
472
473 test "returns user on success", %{check_fn: check_fn} do
474 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today()})
475
476 check_fn.(invite)
477
478 invite = Repo.get_by(UserInviteToken, token: invite.token)
479
480 refute invite.used
481 end
482
483 test "returns user on token which expired tomorrow", %{check_fn: check_fn} do
484 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), 1)})
485
486 check_fn.(invite)
487
488 invite = Repo.get_by(UserInviteToken, token: invite.token)
489
490 refute invite.used
491 end
492
493 test "returns an error on overdue date", %{data: data} do
494 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1)})
495
496 data = Map.put(data, "token", invite.token)
497
498 {:error, msg} = TwitterAPI.register_user(data)
499
500 assert msg == "Expired token"
501 refute User.get_by_nickname("vinny")
502 invite = Repo.get_by(UserInviteToken, token: invite.token)
503
504 refute invite.used
505 end
506 end
507
508 describe "registers with reusable token" do
509 setup do
510 setting = Pleroma.Config.get([:instance, :registrations_open])
511
512 if setting do
513 Pleroma.Config.put([:instance, :registrations_open], false)
514 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
515 end
516
517 :ok
518 end
519
520 test "returns user on success, after him registration fails" do
521 {:ok, invite} = UserInviteToken.create_invite(%{max_use: 100})
522
523 UserInviteToken.update_invite!(invite, uses: 99)
524
525 data = %{
526 "nickname" => "vinny",
527 "email" => "pasta@pizza.vs",
528 "fullname" => "Vinny Vinesauce",
529 "bio" => "streamer",
530 "password" => "hiptofbees",
531 "confirm" => "hiptofbees",
532 "token" => invite.token
533 }
534
535 {:ok, user} = TwitterAPI.register_user(data)
536 fetched_user = User.get_by_nickname("vinny")
537 invite = Repo.get_by(UserInviteToken, token: invite.token)
538
539 assert invite.used == true
540
541 assert UserView.render("show.json", %{user: user}) ==
542 UserView.render("show.json", %{user: fetched_user})
543
544 data = %{
545 "nickname" => "GrimReaper",
546 "email" => "death@reapers.afterlife",
547 "fullname" => "Reaper Grim",
548 "bio" => "Your time has come",
549 "password" => "scythe",
550 "confirm" => "scythe",
551 "token" => invite.token
552 }
553
554 {:error, msg} = TwitterAPI.register_user(data)
555
556 assert msg == "Expired token"
557 refute User.get_by_nickname("GrimReaper")
558 end
559 end
560
561 describe "registers with reusable date limited token" do
562 setup do
563 setting = Pleroma.Config.get([:instance, :registrations_open])
564
565 if setting do
566 Pleroma.Config.put([:instance, :registrations_open], false)
567 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
568 end
569
570 :ok
571 end
572
573 test "returns user on success" do
574 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
575
576 data = %{
577 "nickname" => "vinny",
578 "email" => "pasta@pizza.vs",
579 "fullname" => "Vinny Vinesauce",
580 "bio" => "streamer",
581 "password" => "hiptofbees",
582 "confirm" => "hiptofbees",
583 "token" => invite.token
584 }
585
586 {:ok, user} = TwitterAPI.register_user(data)
587 fetched_user = User.get_by_nickname("vinny")
588 invite = Repo.get_by(UserInviteToken, token: invite.token)
589
590 refute invite.used
591
592 assert UserView.render("show.json", %{user: user}) ==
593 UserView.render("show.json", %{user: fetched_user})
594 end
595
596 test "error after max uses" do
597 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
598
599 UserInviteToken.update_invite!(invite, uses: 99)
600
601 data = %{
602 "nickname" => "vinny",
603 "email" => "pasta@pizza.vs",
604 "fullname" => "Vinny Vinesauce",
605 "bio" => "streamer",
606 "password" => "hiptofbees",
607 "confirm" => "hiptofbees",
608 "token" => invite.token
609 }
610
611 {:ok, user} = TwitterAPI.register_user(data)
612 fetched_user = User.get_by_nickname("vinny")
613 invite = Repo.get_by(UserInviteToken, token: invite.token)
614 assert invite.used == true
615
616 assert UserView.render("show.json", %{user: user}) ==
617 UserView.render("show.json", %{user: fetched_user})
618
619 data = %{
620 "nickname" => "GrimReaper",
621 "email" => "death@reapers.afterlife",
622 "fullname" => "Reaper Grim",
623 "bio" => "Your time has come",
624 "password" => "scythe",
625 "confirm" => "scythe",
626 "token" => invite.token
627 }
628
629 {:error, msg} = TwitterAPI.register_user(data)
630
631 assert msg == "Expired token"
632 refute User.get_by_nickname("GrimReaper")
633 end
634
635 test "returns error on overdue date" do
636 {:ok, invite} =
637 UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1), max_use: 100})
638
639 data = %{
640 "nickname" => "GrimReaper",
641 "email" => "death@reapers.afterlife",
642 "fullname" => "Reaper Grim",
643 "bio" => "Your time has come",
644 "password" => "scythe",
645 "confirm" => "scythe",
646 "token" => invite.token
647 }
648
649 {:error, msg} = TwitterAPI.register_user(data)
650
651 assert msg == "Expired token"
652 refute User.get_by_nickname("GrimReaper")
653 end
654
655 test "returns error on with overdue date and after max" do
656 {:ok, invite} =
657 UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1), max_use: 100})
658
659 UserInviteToken.update_invite!(invite, uses: 100)
660
661 data = %{
662 "nickname" => "GrimReaper",
663 "email" => "death@reapers.afterlife",
664 "fullname" => "Reaper Grim",
665 "bio" => "Your time has come",
666 "password" => "scythe",
667 "confirm" => "scythe",
668 "token" => invite.token
669 }
670
671 {:error, msg} = TwitterAPI.register_user(data)
672
673 assert msg == "Expired token"
674 refute User.get_by_nickname("GrimReaper")
675 end
676 end
677
678 test "it returns the error on registration problems" do
679 data = %{
680 "nickname" => "lain",
681 "email" => "lain@wired.jp",
682 "fullname" => "lain iwakura",
683 "bio" => "close the world.",
684 "password" => "bear"
685 }
686
687 {:error, error_object} = TwitterAPI.register_user(data)
688
689 assert is_binary(error_object[:error])
690 refute User.get_by_nickname("lain")
691 end
692
693 test "it assigns an integer conversation_id" do
694 note_activity = insert(:note_activity)
695 status = ActivityView.render("activity.json", activity: note_activity)
696
697 assert is_number(status["statusnet_conversation_id"])
698 end
699
700 setup do
701 Supervisor.terminate_child(Pleroma.Supervisor, Cachex)
702 Supervisor.restart_child(Pleroma.Supervisor, Cachex)
703 :ok
704 end
705
706 describe "fetching a user by uri" do
707 test "fetches a user by uri" do
708 id = "https://mastodon.social/users/lambadalambda"
709 user = insert(:user)
710 {:ok, represented} = TwitterAPI.get_external_profile(user, id)
711 remote = User.get_by_ap_id(id)
712
713 assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"]
714
715 # Also fetches the feed.
716 # assert Activity.get_create_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
717 # credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength
718 end
719 end
720 end