Merge branch 'following-relationships-optimizations' into 'develop'
[akkoma] / test / web / common_api / common_api_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.CommonAPITest do
6 use Pleroma.DataCase
7 alias Pleroma.Activity
8 alias Pleroma.Conversation.Participation
9 alias Pleroma.Object
10 alias Pleroma.User
11 alias Pleroma.Web.ActivityPub.ActivityPub
12 alias Pleroma.Web.ActivityPub.Visibility
13 alias Pleroma.Web.AdminAPI.AccountView
14 alias Pleroma.Web.CommonAPI
15
16 import Pleroma.Factory
17
18 require Pleroma.Constants
19
20 clear_config([:instance, :safe_dm_mentions])
21 clear_config([:instance, :limit])
22 clear_config([:instance, :max_pinned_statuses])
23
24 test "when replying to a conversation / participation, it will set the correct context id even if no explicit reply_to is given" do
25 user = insert(:user)
26 {:ok, activity} = CommonAPI.post(user, %{"status" => ".", "visibility" => "direct"})
27
28 [participation] = Participation.for_user(user)
29
30 {:ok, convo_reply} =
31 CommonAPI.post(user, %{"status" => ".", "in_reply_to_conversation_id" => participation.id})
32
33 assert Visibility.is_direct?(convo_reply)
34
35 assert activity.data["context"] == convo_reply.data["context"]
36 end
37
38 test "when replying to a conversation / participation, it only mentions the recipients explicitly declared in the participation" do
39 har = insert(:user)
40 jafnhar = insert(:user)
41 tridi = insert(:user)
42
43 {:ok, activity} =
44 CommonAPI.post(har, %{
45 "status" => "@#{jafnhar.nickname} hey",
46 "visibility" => "direct"
47 })
48
49 assert har.ap_id in activity.recipients
50 assert jafnhar.ap_id in activity.recipients
51
52 [participation] = Participation.for_user(har)
53
54 {:ok, activity} =
55 CommonAPI.post(har, %{
56 "status" => "I don't really like @#{tridi.nickname}",
57 "visibility" => "direct",
58 "in_reply_to_status_id" => activity.id,
59 "in_reply_to_conversation_id" => participation.id
60 })
61
62 assert har.ap_id in activity.recipients
63 assert jafnhar.ap_id in activity.recipients
64 refute tridi.ap_id in activity.recipients
65 end
66
67 test "with the safe_dm_mention option set, it does not mention people beyond the initial tags" do
68 har = insert(:user)
69 jafnhar = insert(:user)
70 tridi = insert(:user)
71
72 Pleroma.Config.put([:instance, :safe_dm_mentions], true)
73
74 {:ok, activity} =
75 CommonAPI.post(har, %{
76 "status" => "@#{jafnhar.nickname} hey, i never want to see @#{tridi.nickname} again",
77 "visibility" => "direct"
78 })
79
80 refute tridi.ap_id in activity.recipients
81 assert jafnhar.ap_id in activity.recipients
82 end
83
84 test "it de-duplicates tags" do
85 user = insert(:user)
86 {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"})
87
88 object = Object.normalize(activity)
89
90 assert object.data["tag"] == ["2hu"]
91 end
92
93 test "it adds emoji in the object" do
94 user = insert(:user)
95 {:ok, activity} = CommonAPI.post(user, %{"status" => ":firefox:"})
96
97 assert Object.normalize(activity).data["emoji"]["firefox"]
98 end
99
100 test "it adds emoji when updating profiles" do
101 user = insert(:user, %{name: ":firefox:"})
102
103 {:ok, activity} = CommonAPI.update(user)
104 user = User.get_cached_by_ap_id(user.ap_id)
105 [firefox] = user.source_data["tag"]
106
107 assert firefox["name"] == ":firefox:"
108
109 assert Pleroma.Constants.as_public() in activity.recipients
110 end
111
112 describe "posting" do
113 test "it supports explicit addressing" do
114 user = insert(:user)
115 user_two = insert(:user)
116 user_three = insert(:user)
117 user_four = insert(:user)
118
119 {:ok, activity} =
120 CommonAPI.post(user, %{
121 "status" =>
122 "Hey, I think @#{user_three.nickname} is ugly. @#{user_four.nickname} is alright though.",
123 "to" => [user_two.nickname, user_four.nickname, "nonexistent"]
124 })
125
126 assert user.ap_id in activity.recipients
127 assert user_two.ap_id in activity.recipients
128 assert user_four.ap_id in activity.recipients
129 refute user_three.ap_id in activity.recipients
130 end
131
132 test "it filters out obviously bad tags when accepting a post as HTML" do
133 user = insert(:user)
134
135 post = "<p><b>2hu</b></p><script>alert('xss')</script>"
136
137 {:ok, activity} =
138 CommonAPI.post(user, %{
139 "status" => post,
140 "content_type" => "text/html"
141 })
142
143 object = Object.normalize(activity)
144
145 assert object.data["content"] == "<p><b>2hu</b></p>alert(&#39;xss&#39;)"
146 end
147
148 test "it filters out obviously bad tags when accepting a post as Markdown" do
149 user = insert(:user)
150
151 post = "<p><b>2hu</b></p><script>alert('xss')</script>"
152
153 {:ok, activity} =
154 CommonAPI.post(user, %{
155 "status" => post,
156 "content_type" => "text/markdown"
157 })
158
159 object = Object.normalize(activity)
160
161 assert object.data["content"] == "<p><b>2hu</b></p>alert(&#39;xss&#39;)"
162 end
163
164 test "it does not allow replies to direct messages that are not direct messages themselves" do
165 user = insert(:user)
166
167 {:ok, activity} = CommonAPI.post(user, %{"status" => "suya..", "visibility" => "direct"})
168
169 assert {:ok, _} =
170 CommonAPI.post(user, %{
171 "status" => "suya..",
172 "visibility" => "direct",
173 "in_reply_to_status_id" => activity.id
174 })
175
176 Enum.each(["public", "private", "unlisted"], fn visibility ->
177 assert {:error, "The message visibility must be direct"} =
178 CommonAPI.post(user, %{
179 "status" => "suya..",
180 "visibility" => visibility,
181 "in_reply_to_status_id" => activity.id
182 })
183 end)
184 end
185
186 test "it allows to address a list" do
187 user = insert(:user)
188 {:ok, list} = Pleroma.List.create("foo", user)
189
190 {:ok, activity} =
191 CommonAPI.post(user, %{"status" => "foobar", "visibility" => "list:#{list.id}"})
192
193 assert activity.data["bcc"] == [list.ap_id]
194 assert activity.recipients == [list.ap_id, user.ap_id]
195 assert activity.data["listMessage"] == list.ap_id
196 end
197
198 test "it returns error when status is empty and no attachments" do
199 user = insert(:user)
200
201 assert {:error, "Cannot post an empty status without attachments"} =
202 CommonAPI.post(user, %{"status" => ""})
203 end
204
205 test "it validates character limits are correctly enforced" do
206 Pleroma.Config.put([:instance, :limit], 5)
207
208 user = insert(:user)
209
210 assert {:error, "The status is over the character limit"} =
211 CommonAPI.post(user, %{"status" => "foobar"})
212
213 assert {:ok, activity} = CommonAPI.post(user, %{"status" => "12345"})
214 end
215
216 test "it can handle activities that expire" do
217 user = insert(:user)
218
219 expires_at =
220 NaiveDateTime.utc_now()
221 |> NaiveDateTime.truncate(:second)
222 |> NaiveDateTime.add(1_000_000, :second)
223
224 assert {:ok, activity} =
225 CommonAPI.post(user, %{"status" => "chai", "expires_in" => 1_000_000})
226
227 assert expiration = Pleroma.ActivityExpiration.get_by_activity_id(activity.id)
228 assert expiration.scheduled_at == expires_at
229 end
230 end
231
232 describe "reactions" do
233 test "reacting to a status with an emoji" do
234 user = insert(:user)
235 other_user = insert(:user)
236
237 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
238
239 {:ok, reaction, _} = CommonAPI.react_with_emoji(activity.id, user, "👍")
240
241 assert reaction.data["actor"] == user.ap_id
242 assert reaction.data["content"] == "👍"
243
244 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
245
246 {:error, _} = CommonAPI.react_with_emoji(activity.id, user, ".")
247 end
248
249 test "unreacting to a status with an emoji" do
250 user = insert(:user)
251 other_user = insert(:user)
252
253 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
254 {:ok, reaction, _} = CommonAPI.react_with_emoji(activity.id, user, "👍")
255
256 {:ok, unreaction, _} = CommonAPI.unreact_with_emoji(activity.id, user, "👍")
257
258 assert unreaction.data["type"] == "Undo"
259 assert unreaction.data["object"] == reaction.data["id"]
260 end
261
262 test "repeating a status" do
263 user = insert(:user)
264 other_user = insert(:user)
265
266 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
267
268 {:ok, %Activity{}, _} = CommonAPI.repeat(activity.id, user)
269 end
270
271 test "can't repeat a repeat" do
272 user = insert(:user)
273 other_user = insert(:user)
274 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
275
276 {:ok, %Activity{} = announce, _} = CommonAPI.repeat(activity.id, other_user)
277
278 refute match?({:ok, %Activity{}, _}, CommonAPI.repeat(announce.id, user))
279 end
280
281 test "repeating a status privately" do
282 user = insert(:user)
283 other_user = insert(:user)
284
285 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
286
287 {:ok, %Activity{} = announce_activity, _} =
288 CommonAPI.repeat(activity.id, user, %{"visibility" => "private"})
289
290 assert Visibility.is_private?(announce_activity)
291 end
292
293 test "favoriting a status" do
294 user = insert(:user)
295 other_user = insert(:user)
296
297 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
298
299 {:ok, %Activity{}, _} = CommonAPI.favorite(activity.id, user)
300 end
301
302 test "retweeting a status twice returns the status" do
303 user = insert(:user)
304 other_user = insert(:user)
305
306 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
307 {:ok, %Activity{} = announce, object} = CommonAPI.repeat(activity.id, user)
308 {:ok, ^announce, ^object} = CommonAPI.repeat(activity.id, user)
309 end
310
311 test "favoriting a status twice returns the status" do
312 user = insert(:user)
313 other_user = insert(:user)
314
315 {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
316 {:ok, %Activity{} = activity, object} = CommonAPI.favorite(activity.id, user)
317 {:ok, ^activity, ^object} = CommonAPI.favorite(activity.id, user)
318 end
319 end
320
321 describe "pinned statuses" do
322 setup do
323 Pleroma.Config.put([:instance, :max_pinned_statuses], 1)
324
325 user = insert(:user)
326 {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!"})
327
328 [user: user, activity: activity]
329 end
330
331 test "pin status", %{user: user, activity: activity} do
332 assert {:ok, ^activity} = CommonAPI.pin(activity.id, user)
333
334 id = activity.id
335 user = refresh_record(user)
336
337 assert %User{pinned_activities: [^id]} = user
338 end
339
340 test "pin poll", %{user: user} do
341 {:ok, activity} =
342 CommonAPI.post(user, %{
343 "status" => "How is fediverse today?",
344 "poll" => %{"options" => ["Absolutely outstanding", "Not good"], "expires_in" => 20}
345 })
346
347 assert {:ok, ^activity} = CommonAPI.pin(activity.id, user)
348
349 id = activity.id
350 user = refresh_record(user)
351
352 assert %User{pinned_activities: [^id]} = user
353 end
354
355 test "unlisted statuses can be pinned", %{user: user} do
356 {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!", "visibility" => "unlisted"})
357 assert {:ok, ^activity} = CommonAPI.pin(activity.id, user)
358 end
359
360 test "only self-authored can be pinned", %{activity: activity} do
361 user = insert(:user)
362
363 assert {:error, "Could not pin"} = CommonAPI.pin(activity.id, user)
364 end
365
366 test "max pinned statuses", %{user: user, activity: activity_one} do
367 {:ok, activity_two} = CommonAPI.post(user, %{"status" => "HI!!!"})
368
369 assert {:ok, ^activity_one} = CommonAPI.pin(activity_one.id, user)
370
371 user = refresh_record(user)
372
373 assert {:error, "You have already pinned the maximum number of statuses"} =
374 CommonAPI.pin(activity_two.id, user)
375 end
376
377 test "unpin status", %{user: user, activity: activity} do
378 {:ok, activity} = CommonAPI.pin(activity.id, user)
379
380 user = refresh_record(user)
381
382 id = activity.id
383
384 assert match?({:ok, %{id: ^id}}, CommonAPI.unpin(activity.id, user))
385
386 user = refresh_record(user)
387
388 assert %User{pinned_activities: []} = user
389 end
390
391 test "should unpin when deleting a status", %{user: user, activity: activity} do
392 {:ok, activity} = CommonAPI.pin(activity.id, user)
393
394 user = refresh_record(user)
395
396 assert {:ok, _} = CommonAPI.delete(activity.id, user)
397
398 user = refresh_record(user)
399
400 assert %User{pinned_activities: []} = user
401 end
402 end
403
404 describe "mute tests" do
405 setup do
406 user = insert(:user)
407
408 activity = insert(:note_activity)
409
410 [user: user, activity: activity]
411 end
412
413 test "add mute", %{user: user, activity: activity} do
414 {:ok, _} = CommonAPI.add_mute(user, activity)
415 assert CommonAPI.thread_muted?(user, activity)
416 end
417
418 test "remove mute", %{user: user, activity: activity} do
419 CommonAPI.add_mute(user, activity)
420 {:ok, _} = CommonAPI.remove_mute(user, activity)
421 refute CommonAPI.thread_muted?(user, activity)
422 end
423
424 test "check that mutes can't be duplicate", %{user: user, activity: activity} do
425 CommonAPI.add_mute(user, activity)
426 {:error, _} = CommonAPI.add_mute(user, activity)
427 end
428 end
429
430 describe "reports" do
431 test "creates a report" do
432 reporter = insert(:user)
433 target_user = insert(:user)
434
435 {:ok, activity} = CommonAPI.post(target_user, %{"status" => "foobar"})
436
437 reporter_ap_id = reporter.ap_id
438 target_ap_id = target_user.ap_id
439 activity_ap_id = activity.data["id"]
440 comment = "foobar"
441
442 report_data = %{
443 "account_id" => target_user.id,
444 "comment" => comment,
445 "status_ids" => [activity.id]
446 }
447
448 note_obj = %{
449 "type" => "Note",
450 "id" => activity_ap_id,
451 "content" => "foobar",
452 "published" => activity.object.data["published"],
453 "actor" => AccountView.render("show.json", %{user: target_user})
454 }
455
456 assert {:ok, flag_activity} = CommonAPI.report(reporter, report_data)
457
458 assert %Activity{
459 actor: ^reporter_ap_id,
460 data: %{
461 "type" => "Flag",
462 "content" => ^comment,
463 "object" => [^target_ap_id, ^note_obj],
464 "state" => "open"
465 }
466 } = flag_activity
467 end
468
469 test "updates report state" do
470 [reporter, target_user] = insert_pair(:user)
471 activity = insert(:note_activity, user: target_user)
472
473 {:ok, %Activity{id: report_id}} =
474 CommonAPI.report(reporter, %{
475 "account_id" => target_user.id,
476 "comment" => "I feel offended",
477 "status_ids" => [activity.id]
478 })
479
480 {:ok, report} = CommonAPI.update_report_state(report_id, "resolved")
481
482 assert report.data["state"] == "resolved"
483
484 [reported_user, activity_id] = report.data["object"]
485
486 assert reported_user == target_user.ap_id
487 assert activity_id == activity.data["id"]
488 end
489
490 test "does not update report state when state is unsupported" do
491 [reporter, target_user] = insert_pair(:user)
492 activity = insert(:note_activity, user: target_user)
493
494 {:ok, %Activity{id: report_id}} =
495 CommonAPI.report(reporter, %{
496 "account_id" => target_user.id,
497 "comment" => "I feel offended",
498 "status_ids" => [activity.id]
499 })
500
501 assert CommonAPI.update_report_state(report_id, "test") == {:error, "Unsupported state"}
502 end
503
504 test "updates state of multiple reports" do
505 [reporter, target_user] = insert_pair(:user)
506 activity = insert(:note_activity, user: target_user)
507
508 {:ok, %Activity{id: first_report_id}} =
509 CommonAPI.report(reporter, %{
510 "account_id" => target_user.id,
511 "comment" => "I feel offended",
512 "status_ids" => [activity.id]
513 })
514
515 {:ok, %Activity{id: second_report_id}} =
516 CommonAPI.report(reporter, %{
517 "account_id" => target_user.id,
518 "comment" => "I feel very offended!",
519 "status_ids" => [activity.id]
520 })
521
522 {:ok, report_ids} =
523 CommonAPI.update_report_state([first_report_id, second_report_id], "resolved")
524
525 first_report = Activity.get_by_id(first_report_id)
526 second_report = Activity.get_by_id(second_report_id)
527
528 assert report_ids -- [first_report_id, second_report_id] == []
529 assert first_report.data["state"] == "resolved"
530 assert second_report.data["state"] == "resolved"
531 end
532 end
533
534 describe "reblog muting" do
535 setup do
536 muter = insert(:user)
537
538 muted = insert(:user)
539
540 [muter: muter, muted: muted]
541 end
542
543 test "add a reblog mute", %{muter: muter, muted: muted} do
544 {:ok, _reblog_mute} = CommonAPI.hide_reblogs(muter, muted)
545
546 assert User.showing_reblogs?(muter, muted) == false
547 end
548
549 test "remove a reblog mute", %{muter: muter, muted: muted} do
550 {:ok, _reblog_mute} = CommonAPI.hide_reblogs(muter, muted)
551 {:ok, _reblog_mute} = CommonAPI.show_reblogs(muter, muted)
552
553 assert User.showing_reblogs?(muter, muted) == true
554 end
555 end
556
557 describe "unfollow/2" do
558 test "also unsubscribes a user" do
559 [follower, followed] = insert_pair(:user)
560 {:ok, follower, followed, _} = CommonAPI.follow(follower, followed)
561 {:ok, _subscription} = User.subscribe(follower, followed)
562
563 assert User.subscribed_to?(follower, followed)
564
565 {:ok, follower} = CommonAPI.unfollow(follower, followed)
566
567 refute User.subscribed_to?(follower, followed)
568 end
569
570 test "cancels a pending follow for a local user" do
571 follower = insert(:user)
572 followed = insert(:user, locked: true)
573
574 assert {:ok, follower, followed, %{id: activity_id, data: %{"state" => "pending"}}} =
575 CommonAPI.follow(follower, followed)
576
577 assert User.get_follow_state(follower, followed) == :follow_pending
578 assert {:ok, follower} = CommonAPI.unfollow(follower, followed)
579 assert User.get_follow_state(follower, followed) == nil
580
581 assert %{id: ^activity_id, data: %{"state" => "cancelled"}} =
582 Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, followed)
583
584 assert %{
585 data: %{
586 "type" => "Undo",
587 "object" => %{"type" => "Follow", "state" => "cancelled"}
588 }
589 } = Pleroma.Web.ActivityPub.Utils.fetch_latest_undo(follower)
590 end
591
592 test "cancels a pending follow for a remote user" do
593 follower = insert(:user)
594 followed = insert(:user, locked: true, local: false, ap_enabled: true)
595
596 assert {:ok, follower, followed, %{id: activity_id, data: %{"state" => "pending"}}} =
597 CommonAPI.follow(follower, followed)
598
599 assert User.get_follow_state(follower, followed) == :follow_pending
600 assert {:ok, follower} = CommonAPI.unfollow(follower, followed)
601 assert User.get_follow_state(follower, followed) == nil
602
603 assert %{id: ^activity_id, data: %{"state" => "cancelled"}} =
604 Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, followed)
605
606 assert %{
607 data: %{
608 "type" => "Undo",
609 "object" => %{"type" => "Follow", "state" => "cancelled"}
610 }
611 } = Pleroma.Web.ActivityPub.Utils.fetch_latest_undo(follower)
612 end
613 end
614
615 describe "accept_follow_request/2" do
616 test "after acceptance, it sets all existing pending follow request states to 'accept'" do
617 user = insert(:user, locked: true)
618 follower = insert(:user)
619 follower_two = insert(:user)
620
621 {:ok, follow_activity} = ActivityPub.follow(follower, user)
622 {:ok, follow_activity_two} = ActivityPub.follow(follower, user)
623 {:ok, follow_activity_three} = ActivityPub.follow(follower_two, user)
624
625 assert follow_activity.data["state"] == "pending"
626 assert follow_activity_two.data["state"] == "pending"
627 assert follow_activity_three.data["state"] == "pending"
628
629 {:ok, _follower} = CommonAPI.accept_follow_request(follower, user)
630
631 assert Repo.get(Activity, follow_activity.id).data["state"] == "accept"
632 assert Repo.get(Activity, follow_activity_two.id).data["state"] == "accept"
633 assert Repo.get(Activity, follow_activity_three.id).data["state"] == "pending"
634 end
635
636 test "after rejection, it sets all existing pending follow request states to 'reject'" do
637 user = insert(:user, locked: true)
638 follower = insert(:user)
639 follower_two = insert(:user)
640
641 {:ok, follow_activity} = ActivityPub.follow(follower, user)
642 {:ok, follow_activity_two} = ActivityPub.follow(follower, user)
643 {:ok, follow_activity_three} = ActivityPub.follow(follower_two, user)
644
645 assert follow_activity.data["state"] == "pending"
646 assert follow_activity_two.data["state"] == "pending"
647 assert follow_activity_three.data["state"] == "pending"
648
649 {:ok, _follower} = CommonAPI.reject_follow_request(follower, user)
650
651 assert Repo.get(Activity, follow_activity.id).data["state"] == "reject"
652 assert Repo.get(Activity, follow_activity_two.id).data["state"] == "reject"
653 assert Repo.get(Activity, follow_activity_three.id).data["state"] == "pending"
654 end
655
656 test "doesn't create a following relationship if the corresponding follow request doesn't exist" do
657 user = insert(:user, locked: true)
658 not_follower = insert(:user)
659 CommonAPI.accept_follow_request(not_follower, user)
660
661 assert Pleroma.FollowingRelationship.following?(not_follower, user) == false
662 end
663 end
664
665 describe "vote/3" do
666 test "does not allow to vote twice" do
667 user = insert(:user)
668 other_user = insert(:user)
669
670 {:ok, activity} =
671 CommonAPI.post(user, %{
672 "status" => "Am I cute?",
673 "poll" => %{"options" => ["Yes", "No"], "expires_in" => 20}
674 })
675
676 object = Object.normalize(activity)
677
678 {:ok, _, object} = CommonAPI.vote(other_user, object, [0])
679
680 assert {:error, "Already voted"} == CommonAPI.vote(other_user, object, [1])
681 end
682 end
683
684 describe "listen/2" do
685 test "returns a valid activity" do
686 user = insert(:user)
687
688 {:ok, activity} =
689 CommonAPI.listen(user, %{
690 "title" => "lain radio episode 1",
691 "album" => "lain radio",
692 "artist" => "lain",
693 "length" => 180_000
694 })
695
696 object = Object.normalize(activity)
697
698 assert object.data["title"] == "lain radio episode 1"
699
700 assert Visibility.get_visibility(activity) == "public"
701 end
702
703 test "respects visibility=private" do
704 user = insert(:user)
705
706 {:ok, activity} =
707 CommonAPI.listen(user, %{
708 "title" => "lain radio episode 1",
709 "album" => "lain radio",
710 "artist" => "lain",
711 "length" => 180_000,
712 "visibility" => "private"
713 })
714
715 object = Object.normalize(activity)
716
717 assert object.data["title"] == "lain radio episode 1"
718
719 assert Visibility.get_visibility(activity) == "private"
720 end
721 end
722 end