about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-10-14 21:42:09 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-10-14 14:42:09 +0200
commit8125fdc19f310a22fdd1395365c2f02d6887b389 (patch)
tree7d85e55d35e6b0b40de87058e449bfe6dd43b860 /spec/lib
parentae716a12e1604a4df54acbc77ff35f591e3168e2 (diff)
Use atomUri in Undo activity of Announce (#5376)
This allows deletion of reblogs which delivered before with OStatus URI.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/activitypub/activity/undo_spec.rb24
1 files changed, 19 insertions, 5 deletions
diff --git a/spec/lib/activitypub/activity/undo_spec.rb b/spec/lib/activitypub/activity/undo_spec.rb
index 14c68efe5..e01c5e03e 100644
--- a/spec/lib/activitypub/activity/undo_spec.rb
+++ b/spec/lib/activitypub/activity/undo_spec.rb
@@ -25,16 +25,30 @@ RSpec.describe ActivityPub::Activity::Undo do
           type: 'Announce',
           actor: ActivityPub::TagManager.instance.uri_for(sender),
           object: ActivityPub::TagManager.instance.uri_for(status),
+          atomUri: 'barbar',
         }
       end
 
-      before do
-        Fabricate(:status, reblog: status, account: sender, uri: 'bar')
+      context do
+        before do
+          Fabricate(:status, reblog: status, account: sender, uri: 'bar')
+        end
+
+        it 'deletes the reblog' do
+          subject.perform
+          expect(sender.reblogged?(status)).to be false
+        end
       end
 
-      it 'deletes the reblog' do
-        subject.perform
-        expect(sender.reblogged?(status)).to be false
+      context 'with atomUri' do
+        before do
+          Fabricate(:status, reblog: status, account: sender, uri: 'barbar')
+        end
+
+        it 'deletes the reblog by atomUri' do
+          subject.perform
+          expect(sender.reblogged?(status)).to be false
+        end
       end
     end