merge develop
[akkoma] / test / web / ostatus / ostatus_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.OStatusTest do
6 use Pleroma.DataCase
7 alias Pleroma.Activity
8 alias Pleroma.Instances
9 alias Pleroma.Object
10 alias Pleroma.Repo
11 alias Pleroma.User
12 alias Pleroma.Web.OStatus
13 alias Pleroma.Web.XML
14
15 import ExUnit.CaptureLog
16 import Mock
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 "don't insert create notes twice" do
25 incoming = File.read!("test/fixtures/incoming_note_activity.xml")
26 {:ok, [activity]} = OStatus.handle_incoming(incoming)
27 assert {:ok, [activity]} == OStatus.handle_incoming(incoming)
28 end
29
30 test "handle incoming note - GS, Salmon" do
31 incoming = File.read!("test/fixtures/incoming_note_activity.xml")
32 {:ok, [activity]} = OStatus.handle_incoming(incoming)
33 object = Object.normalize(activity)
34
35 user = User.get_cached_by_ap_id(activity.data["actor"])
36 assert user.info.note_count == 1
37 assert activity.data["type"] == "Create"
38 assert object.data["type"] == "Note"
39
40 assert object.data["id"] == "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note"
41
42 assert activity.data["published"] == "2017-04-23T14:51:03+00:00"
43 assert object.data["published"] == "2017-04-23T14:51:03+00:00"
44
45 assert activity.data["context"] ==
46 "tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b"
47
48 assert "http://pleroma.example.org:4000/users/lain3" in activity.data["to"]
49 assert object.data["emoji"] == %{"marko" => "marko.png", "reimu" => "reimu.png"}
50 assert activity.local == false
51 end
52
53 test "handle incoming notes - GS, subscription" do
54 incoming = File.read!("test/fixtures/ostatus_incoming_post.xml")
55 {:ok, [activity]} = OStatus.handle_incoming(incoming)
56 object = Object.normalize(activity)
57
58 assert activity.data["type"] == "Create"
59 assert object.data["type"] == "Note"
60 assert object.data["actor"] == "https://social.heldscal.la/user/23211"
61 assert object.data["content"] == "Will it blend?"
62 user = User.get_cached_by_ap_id(activity.data["actor"])
63 assert User.ap_followers(user) in activity.data["to"]
64 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
65 end
66
67 test "handle incoming notes with attachments - GS, subscription" do
68 incoming = File.read!("test/fixtures/incoming_websub_gnusocial_attachments.xml")
69 {:ok, [activity]} = OStatus.handle_incoming(incoming)
70 object = Object.normalize(activity)
71
72 assert activity.data["type"] == "Create"
73 assert object.data["type"] == "Note"
74 assert object.data["actor"] == "https://social.heldscal.la/user/23211"
75 assert object.data["attachment"] |> length == 2
76 assert object.data["external_url"] == "https://social.heldscal.la/notice/2020923"
77 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
78 end
79
80 test "handle incoming notes with tags" do
81 incoming = File.read!("test/fixtures/ostatus_incoming_post_tag.xml")
82 {:ok, [activity]} = OStatus.handle_incoming(incoming)
83 object = Object.normalize(activity)
84
85 assert object.data["tag"] == ["nsfw"]
86 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
87 end
88
89 test "handle incoming notes - Mastodon, salmon, reply" do
90 # It uses the context of the replied to object
91 Repo.insert!(%Object{
92 data: %{
93 "id" => "https://pleroma.soykaf.com/objects/c237d966-ac75-4fe3-a87a-d89d71a3a7a4",
94 "context" => "2hu"
95 }
96 })
97
98 incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml")
99 {:ok, [activity]} = OStatus.handle_incoming(incoming)
100 object = Object.normalize(activity)
101
102 assert activity.data["type"] == "Create"
103 assert object.data["type"] == "Note"
104 assert object.data["actor"] == "https://mastodon.social/users/lambadalambda"
105 assert activity.data["context"] == "2hu"
106 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
107 end
108
109 test "handle incoming notes - Mastodon, with CW" do
110 incoming = File.read!("test/fixtures/mastodon-note-cw.xml")
111 {:ok, [activity]} = OStatus.handle_incoming(incoming)
112 object = Object.normalize(activity)
113
114 assert activity.data["type"] == "Create"
115 assert object.data["type"] == "Note"
116 assert object.data["actor"] == "https://mastodon.social/users/lambadalambda"
117 assert object.data["summary"] == "technologic"
118 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
119 end
120
121 test "handle incoming unlisted messages, put public into cc" do
122 incoming = File.read!("test/fixtures/mastodon-note-unlisted.xml")
123 {:ok, [activity]} = OStatus.handle_incoming(incoming)
124 object = Object.normalize(activity)
125
126 refute "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
127 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["cc"]
128 refute "https://www.w3.org/ns/activitystreams#Public" in object.data["to"]
129 assert "https://www.w3.org/ns/activitystreams#Public" in object.data["cc"]
130 end
131
132 test "handle incoming retweets - Mastodon, with CW" do
133 incoming = File.read!("test/fixtures/cw_retweet.xml")
134 {:ok, [[_activity, retweeted_activity]]} = OStatus.handle_incoming(incoming)
135 retweeted_object = Object.normalize(retweeted_activity)
136
137 assert retweeted_object.data["summary"] == "Hey."
138 end
139
140 test "handle incoming notes - GS, subscription, reply" do
141 incoming = File.read!("test/fixtures/ostatus_incoming_reply.xml")
142 {:ok, [activity]} = OStatus.handle_incoming(incoming)
143 object = Object.normalize(activity)
144
145 assert activity.data["type"] == "Create"
146 assert object.data["type"] == "Note"
147 assert object.data["actor"] == "https://social.heldscal.la/user/23211"
148
149 assert object.data["content"] ==
150 "@<a href=\"https://gs.archae.me/user/4687\" class=\"h-card u-url p-nickname mention\" title=\"shpbot\">shpbot</a> why not indeed."
151
152 assert object.data["inReplyTo"] ==
153 "tag:gs.archae.me,2017-04-30:noticeId=778260:objectType=note"
154
155 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
156 end
157
158 test "handle incoming retweets - GS, subscription" do
159 incoming = File.read!("test/fixtures/share-gs.xml")
160 {:ok, [[activity, retweeted_activity]]} = OStatus.handle_incoming(incoming)
161
162 assert activity.data["type"] == "Announce"
163 assert activity.data["actor"] == "https://social.heldscal.la/user/23211"
164 assert activity.data["object"] == retweeted_activity.data["object"]
165 assert "https://pleroma.soykaf.com/users/lain" in activity.data["to"]
166 refute activity.local
167
168 retweeted_activity = Activity.get_by_id(retweeted_activity.id)
169 retweeted_object = Object.normalize(retweeted_activity)
170 assert retweeted_activity.data["type"] == "Create"
171 assert retweeted_activity.data["actor"] == "https://pleroma.soykaf.com/users/lain"
172 refute retweeted_activity.local
173 assert retweeted_object.data["announcement_count"] == 1
174 assert String.contains?(retweeted_object.data["content"], "mastodon")
175 refute String.contains?(retweeted_object.data["content"], "Test account")
176 end
177
178 test "handle incoming retweets - GS, subscription - local message" do
179 incoming = File.read!("test/fixtures/share-gs-local.xml")
180 note_activity = insert(:note_activity)
181 object = Object.normalize(note_activity)
182 user = User.get_cached_by_ap_id(note_activity.data["actor"])
183
184 incoming =
185 incoming
186 |> String.replace("LOCAL_ID", object.data["id"])
187 |> String.replace("LOCAL_USER", user.ap_id)
188
189 {:ok, [[activity, retweeted_activity]]} = OStatus.handle_incoming(incoming)
190
191 assert activity.data["type"] == "Announce"
192 assert activity.data["actor"] == "https://social.heldscal.la/user/23211"
193 assert activity.data["object"] == object.data["id"]
194 assert user.ap_id in activity.data["to"]
195 refute activity.local
196
197 retweeted_activity = Activity.get_by_id(retweeted_activity.id)
198 assert note_activity.id == retweeted_activity.id
199 assert retweeted_activity.data["type"] == "Create"
200 assert retweeted_activity.data["actor"] == user.ap_id
201 assert retweeted_activity.local
202 assert retweeted_activity.data["object"]["announcement_count"] == 1
203 end
204
205 test "handle incoming retweets - Mastodon, salmon" do
206 incoming = File.read!("test/fixtures/share.xml")
207 {:ok, [[activity, retweeted_activity]]} = OStatus.handle_incoming(incoming)
208 retweeted_object = Object.normalize(retweeted_activity)
209
210 assert activity.data["type"] == "Announce"
211 assert activity.data["actor"] == "https://mastodon.social/users/lambadalambda"
212 assert activity.data["object"] == retweeted_activity.data["object"]
213
214 assert activity.data["id"] ==
215 "tag:mastodon.social,2017-05-03:objectId=4934452:objectType=Status"
216
217 refute activity.local
218 assert retweeted_activity.data["type"] == "Create"
219 assert retweeted_activity.data["actor"] == "https://pleroma.soykaf.com/users/lain"
220 refute retweeted_activity.local
221 refute String.contains?(retweeted_object.data["content"], "Test account")
222 end
223
224 test "handle incoming favorites - GS, websub" do
225 capture_log(fn ->
226 incoming = File.read!("test/fixtures/favorite.xml")
227 {:ok, [[activity, favorited_activity]]} = OStatus.handle_incoming(incoming)
228
229 assert activity.data["type"] == "Like"
230 assert activity.data["actor"] == "https://social.heldscal.la/user/23211"
231 assert activity.data["object"] == favorited_activity.data["object"]
232
233 assert activity.data["id"] ==
234 "tag:social.heldscal.la,2017-05-05:fave:23211:comment:2061643:2017-05-05T09:12:50+00:00"
235
236 refute activity.local
237 assert favorited_activity.data["type"] == "Create"
238 assert favorited_activity.data["actor"] == "https://shitposter.club/user/1"
239
240 assert favorited_activity.data["object"] ==
241 "tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment"
242
243 refute favorited_activity.local
244 end)
245 end
246
247 test "handle conversation references" do
248 incoming = File.read!("test/fixtures/mastodon_conversation.xml")
249 {:ok, [activity]} = OStatus.handle_incoming(incoming)
250
251 assert activity.data["context"] ==
252 "tag:mastodon.social,2017-08-28:objectId=7876885:objectType=Conversation"
253 end
254
255 test "handle incoming favorites with locally available object - GS, websub" do
256 note_activity = insert(:note_activity)
257 object = Object.normalize(note_activity)
258
259 incoming =
260 File.read!("test/fixtures/favorite_with_local_note.xml")
261 |> String.replace("localid", object.data["id"])
262
263 {:ok, [[activity, favorited_activity]]} = OStatus.handle_incoming(incoming)
264
265 assert activity.data["type"] == "Like"
266 assert activity.data["actor"] == "https://social.heldscal.la/user/23211"
267 assert activity.data["object"] == object.data["id"]
268 refute activity.local
269 assert note_activity.id == favorited_activity.id
270 assert favorited_activity.local
271 end
272
273 test_with_mock "handle incoming replies, fetching replied-to activities if we don't have them",
274 OStatus,
275 [:passthrough],
276 [] do
277 incoming = File.read!("test/fixtures/incoming_note_activity_answer.xml")
278 {:ok, [activity]} = OStatus.handle_incoming(incoming)
279 object = Object.normalize(activity, false)
280
281 assert activity.data["type"] == "Create"
282 assert object.data["type"] == "Note"
283
284 assert object.data["inReplyTo"] ==
285 "http://pleroma.example.org:4000/objects/55bce8fc-b423-46b1-af71-3759ab4670bc"
286
287 assert "http://pleroma.example.org:4000/users/lain5" in activity.data["to"]
288
289 assert object.data["id"] == "tag:gs.example.org:4040,2017-04-25:noticeId=55:objectType=note"
290
291 assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"]
292
293 assert called(OStatus.fetch_activity_from_url(object.data["inReplyTo"], :_))
294 end
295
296 test_with_mock "handle incoming replies, not fetching replied-to activities beyond max_replies_depth",
297 OStatus,
298 [:passthrough],
299 [] do
300 incoming = File.read!("test/fixtures/incoming_note_activity_answer.xml")
301
302 with_mock Pleroma.Web.Federator,
303 allowed_incoming_reply_depth?: fn _ -> false end do
304 {:ok, [activity]} = OStatus.handle_incoming(incoming)
305 object = Object.normalize(activity, false)
306
307 refute called(OStatus.fetch_activity_from_url(object.data["inReplyTo"], :_))
308 end
309 end
310
311 test "handle incoming follows" do
312 incoming = File.read!("test/fixtures/follow.xml")
313 {:ok, [activity]} = OStatus.handle_incoming(incoming)
314 assert activity.data["type"] == "Follow"
315
316 assert activity.data["id"] ==
317 "tag:social.heldscal.la,2017-05-07:subscription:23211:person:44803:2017-05-07T09:54:48+00:00"
318
319 assert activity.data["actor"] == "https://social.heldscal.la/user/23211"
320 assert activity.data["object"] == "https://pawoo.net/users/pekorino"
321 refute activity.local
322
323 follower = User.get_cached_by_ap_id(activity.data["actor"])
324 followed = User.get_cached_by_ap_id(activity.data["object"])
325
326 assert User.following?(follower, followed)
327 end
328
329 test "handle incoming unfollows with existing follow" do
330 incoming_follow = File.read!("test/fixtures/follow.xml")
331 {:ok, [_activity]} = OStatus.handle_incoming(incoming_follow)
332
333 incoming = File.read!("test/fixtures/unfollow.xml")
334 {:ok, [activity]} = OStatus.handle_incoming(incoming)
335
336 assert activity.data["type"] == "Undo"
337
338 assert activity.data["id"] ==
339 "undo:tag:social.heldscal.la,2017-05-07:subscription:23211:person:44803:2017-05-07T09:54:48+00:00"
340
341 assert activity.data["actor"] == "https://social.heldscal.la/user/23211"
342 embedded_object = activity.data["object"]
343 assert is_map(embedded_object)
344 assert embedded_object["type"] == "Follow"
345 assert embedded_object["object"] == "https://pawoo.net/users/pekorino"
346 refute activity.local
347
348 follower = User.get_cached_by_ap_id(activity.data["actor"])
349 followed = User.get_cached_by_ap_id(embedded_object["object"])
350
351 refute User.following?(follower, followed)
352 end
353
354 test "it clears `unreachable` federation status of the sender" do
355 incoming_reaction_xml = File.read!("test/fixtures/share-gs.xml")
356 doc = XML.parse_document(incoming_reaction_xml)
357 actor_uri = XML.string_from_xpath("//author/uri[1]", doc)
358 reacted_to_author_uri = XML.string_from_xpath("//author/uri[2]", doc)
359
360 Instances.set_consistently_unreachable(actor_uri)
361 Instances.set_consistently_unreachable(reacted_to_author_uri)
362 refute Instances.reachable?(actor_uri)
363 refute Instances.reachable?(reacted_to_author_uri)
364
365 {:ok, _} = OStatus.handle_incoming(incoming_reaction_xml)
366 assert Instances.reachable?(actor_uri)
367 refute Instances.reachable?(reacted_to_author_uri)
368 end
369
370 describe "new remote user creation" do
371 test "returns local users" do
372 local_user = insert(:user)
373 {:ok, user} = OStatus.find_or_make_user(local_user.ap_id)
374
375 assert user == local_user
376 end
377
378 test "tries to use the information in poco fields" do
379 uri = "https://social.heldscal.la/user/23211"
380
381 {:ok, user} = OStatus.find_or_make_user(uri)
382
383 user = User.get_cached_by_id(user.id)
384 assert user.name == "Constance Variable"
385 assert user.nickname == "lambadalambda@social.heldscal.la"
386 assert user.local == false
387 assert user.info.uri == uri
388 assert user.ap_id == uri
389 assert user.bio == "Call me Deacon Blues."
390 assert user.avatar["type"] == "Image"
391
392 {:ok, user_again} = OStatus.find_or_make_user(uri)
393
394 assert user == user_again
395 end
396
397 test "find_or_make_user sets all the nessary input fields" do
398 uri = "https://social.heldscal.la/user/23211"
399 {:ok, user} = OStatus.find_or_make_user(uri)
400
401 assert user.info ==
402 %User.Info{
403 id: user.info.id,
404 ap_enabled: false,
405 background: %{},
406 banner: %{},
407 blocks: [],
408 deactivated: false,
409 default_scope: "public",
410 domain_blocks: [],
411 follower_count: 0,
412 is_admin: false,
413 is_moderator: false,
414 keys: nil,
415 locked: false,
416 no_rich_text: false,
417 note_count: 0,
418 settings: nil,
419 source_data: %{},
420 hub: "https://social.heldscal.la/main/push/hub",
421 magic_key:
422 "RSA.uzg6r1peZU0vXGADWxGJ0PE34WvmhjUmydbX5YYdOiXfODVLwCMi1umGoqUDm-mRu4vNEdFBVJU1CpFA7dKzWgIsqsa501i2XqElmEveXRLvNRWFB6nG03Q5OUY2as8eE54BJm0p20GkMfIJGwP6TSFb-ICp3QjzbatuSPJ6xCE=.AQAB",
423 salmon: "https://social.heldscal.la/main/salmon/user/23211",
424 topic: "https://social.heldscal.la/api/statuses/user_timeline/23211.atom",
425 uri: "https://social.heldscal.la/user/23211"
426 }
427 end
428
429 test "find_make_or_update_user takes an author element and returns an updated user" do
430 uri = "https://social.heldscal.la/user/23211"
431
432 {:ok, user} = OStatus.find_or_make_user(uri)
433 old_name = user.name
434 old_bio = user.bio
435 change = Ecto.Changeset.change(user, %{avatar: nil, bio: nil, name: nil})
436
437 {:ok, user} = Repo.update(change)
438 refute user.avatar
439
440 doc = XML.parse_document(File.read!("test/fixtures/23211.atom"))
441 [author] = :xmerl_xpath.string('//author[1]', doc)
442 {:ok, user} = OStatus.find_make_or_update_user(author)
443 assert user.avatar["type"] == "Image"
444 assert user.name == old_name
445 assert user.bio == old_bio
446
447 {:ok, user_again} = OStatus.find_make_or_update_user(author)
448 assert user_again == user
449 end
450 end
451
452 describe "gathering user info from a user id" do
453 test "it returns user info in a hash" do
454 user = "shp@social.heldscal.la"
455
456 # TODO: make test local
457 {:ok, data} = OStatus.gather_user_info(user)
458
459 expected = %{
460 "hub" => "https://social.heldscal.la/main/push/hub",
461 "magic_key" =>
462 "RSA.wQ3i9UA0qmAxZ0WTIp4a-waZn_17Ez1pEEmqmqoooRsG1_BvpmOvLN0G2tEcWWxl2KOtdQMCiPptmQObeZeuj48mdsDZ4ArQinexY2hCCTcbV8Xpswpkb8K05RcKipdg07pnI7tAgQ0VWSZDImncL6YUGlG5YN8b5TjGOwk2VG8=.AQAB",
463 "name" => "shp",
464 "nickname" => "shp",
465 "salmon" => "https://social.heldscal.la/main/salmon/user/29191",
466 "subject" => "acct:shp@social.heldscal.la",
467 "topic" => "https://social.heldscal.la/api/statuses/user_timeline/29191.atom",
468 "uri" => "https://social.heldscal.la/user/29191",
469 "host" => "social.heldscal.la",
470 "fqn" => user,
471 "bio" => "cofe",
472 "avatar" => %{
473 "type" => "Image",
474 "url" => [
475 %{
476 "href" => "https://social.heldscal.la/avatar/29191-original-20170421154949.jpeg",
477 "mediaType" => "image/jpeg",
478 "type" => "Link"
479 }
480 ]
481 },
482 "subscribe_address" => "https://social.heldscal.la/main/ostatussub?profile={uri}",
483 "ap_id" => nil
484 }
485
486 assert data == expected
487 end
488
489 test "it works with the uri" do
490 user = "https://social.heldscal.la/user/29191"
491
492 # TODO: make test local
493 {:ok, data} = OStatus.gather_user_info(user)
494
495 expected = %{
496 "hub" => "https://social.heldscal.la/main/push/hub",
497 "magic_key" =>
498 "RSA.wQ3i9UA0qmAxZ0WTIp4a-waZn_17Ez1pEEmqmqoooRsG1_BvpmOvLN0G2tEcWWxl2KOtdQMCiPptmQObeZeuj48mdsDZ4ArQinexY2hCCTcbV8Xpswpkb8K05RcKipdg07pnI7tAgQ0VWSZDImncL6YUGlG5YN8b5TjGOwk2VG8=.AQAB",
499 "name" => "shp",
500 "nickname" => "shp",
501 "salmon" => "https://social.heldscal.la/main/salmon/user/29191",
502 "subject" => "https://social.heldscal.la/user/29191",
503 "topic" => "https://social.heldscal.la/api/statuses/user_timeline/29191.atom",
504 "uri" => "https://social.heldscal.la/user/29191",
505 "host" => "social.heldscal.la",
506 "fqn" => user,
507 "bio" => "cofe",
508 "avatar" => %{
509 "type" => "Image",
510 "url" => [
511 %{
512 "href" => "https://social.heldscal.la/avatar/29191-original-20170421154949.jpeg",
513 "mediaType" => "image/jpeg",
514 "type" => "Link"
515 }
516 ]
517 },
518 "subscribe_address" => "https://social.heldscal.la/main/ostatussub?profile={uri}",
519 "ap_id" => nil
520 }
521
522 assert data == expected
523 end
524 end
525
526 describe "fetching a status by it's HTML url" do
527 test "it builds a missing status from an html url" do
528 capture_log(fn ->
529 url = "https://shitposter.club/notice/2827873"
530 {:ok, [activity]} = OStatus.fetch_activity_from_url(url)
531
532 assert activity.data["actor"] == "https://shitposter.club/user/1"
533
534 assert activity.data["object"] ==
535 "tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment"
536 end)
537 end
538
539 test "it works for atom notes, too" do
540 url = "https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056"
541 {:ok, [activity]} = OStatus.fetch_activity_from_url(url)
542 assert activity.data["actor"] == "https://social.sakamoto.gq/users/eal"
543 assert activity.data["object"] == url
544 end
545 end
546
547 test "it doesn't add nil in the to field" do
548 incoming = File.read!("test/fixtures/nil_mention_entry.xml")
549 {:ok, [activity]} = OStatus.handle_incoming(incoming)
550
551 assert activity.data["to"] == [
552 "http://localhost:4001/users/atarifrosch@social.stopwatchingus-heidelberg.de/followers",
553 "https://www.w3.org/ns/activitystreams#Public"
554 ]
555 end
556
557 describe "is_representable?" do
558 test "Note objects are representable" do
559 note_activity = insert(:note_activity)
560
561 assert OStatus.is_representable?(note_activity)
562 end
563
564 test "Article objects are not representable" do
565 note_activity = insert(:note_activity)
566 note_object = Object.normalize(note_activity)
567
568 note_data =
569 note_object.data
570 |> Map.put("type", "Article")
571
572 Cachex.clear(:object_cache)
573
574 cs = Object.change(note_object, %{data: note_data})
575 {:ok, _article_object} = Repo.update(cs)
576
577 # the underlying object is now an Article instead of a note, so this should fail
578 refute OStatus.is_representable?(note_activity)
579 end
580 end
581 end