about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-05 03:46:36 +0100
committerYamagishi Kazutoshi <ykzts@desire.sh>2019-03-05 11:46:36 +0900
commit0a39c81dd87242feb84da68b8907c3e45620eadf (patch)
tree4db5b4a0b5664f4b8b1540d472ce17935bbcf463 /spec
parent5d3e7cee991d6d3ce989337a42ef6fd352348385 (diff)
Add test ensuring that unknown object types are rejected (#10166)
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/activitypub/activity/create_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb
index 4780c29c8..56c7bfc61 100644
--- a/spec/lib/activitypub/activity/create_spec.rb
+++ b/spec/lib/activitypub/activity/create_spec.rb
@@ -28,6 +28,20 @@ RSpec.describe ActivityPub::Activity::Create do
         subject.perform
       end
 
+      context 'unknown object type' do
+        let(:object_json) do
+          {
+            id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
+            type: 'Banana',
+            content: 'Lorem ipsum',
+          }
+        end
+
+        it 'does not create a status' do
+          expect(sender.statuses.count).to be_zero
+        end
+      end
+
       context 'standalone' do
         let(:object_json) do
           {