about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-17 17:43:54 +0200
committerThibaut Girka <thib@sitedethib.com>2018-08-17 17:43:54 +0200
commit280d7b1df8566239f15130d8bf1e0e2c1d467fc0 (patch)
tree7903e071b0013fb15dcc5a74f6143239dcbaa2c2 /spec/lib
parent4a6bc2482a26aa0441485ca360a3d3c0eeea7fe4 (diff)
parent59f7f4c923494bb8dd6f2881a1610c7b51240d9c (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
	app/models/status.rb
	db/migrate/20180528141303_fix_accounts_unique_index.rb
	db/schema.rb

Resolved by taking upstream changes (no real conflicts, just glitch-soc
specific code too close to actual changes).
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/activitypub/activity/undo_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/activitypub/activity/undo_spec.rb b/spec/lib/activitypub/activity/undo_spec.rb
index e01c5e03e..9545e1f46 100644
--- a/spec/lib/activitypub/activity/undo_spec.rb
+++ b/spec/lib/activitypub/activity/undo_spec.rb
@@ -52,6 +52,32 @@ RSpec.describe ActivityPub::Activity::Undo do
       end
     end
 
+    context 'with Accept' do
+      let(:recipient) { Fabricate(:account) }
+      let(:object_json) do
+        {
+          id: 'bar',
+          type: 'Accept',
+          actor: ActivityPub::TagManager.instance.uri_for(sender),
+          object: 'follow-to-revoke',
+        }
+      end
+
+      before do
+        recipient.follow!(sender, uri: 'follow-to-revoke')
+      end
+
+      it 'deletes follow from recipient to sender' do
+        subject.perform
+        expect(recipient.following?(sender)).to be false
+      end
+
+      it 'creates a follow request from recipient to sender' do
+        subject.perform
+        expect(recipient.requested?(sender)).to be true
+      end
+    end
+
     context 'with Block' do
       let(:recipient) { Fabricate(:account) }