about summary refs log tree commit diff
path: root/spec/serializers/activitypub/device_serializer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/serializers/activitypub/device_serializer_spec.rb')
-rw-r--r--spec/serializers/activitypub/device_serializer_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/serializers/activitypub/device_serializer_spec.rb b/spec/serializers/activitypub/device_serializer_spec.rb
new file mode 100644
index 000000000..2a3be8212
--- /dev/null
+++ b/spec/serializers/activitypub/device_serializer_spec.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe ActivityPub::DeviceSerializer do
+  let(:serialization) do
+    JSON.parse(
+      ActiveModelSerializers::SerializableResource.new(
+        record, serializer: described_class
+      ).to_json
+    )
+  end
+  let(:record) { Fabricate(:device) }
+
+  describe 'type' do
+    it 'returns correct serialized type' do
+      expect(serialization['type']).to eq('Device')
+    end
+  end
+end