diff options
author | Nick Schonning <nschonni@gmail.com> | 2023-02-23 17:17:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 23:17:48 +0100 |
commit | 19614ba2477f3d12468f5ec251ce1cc5f8c6210c (patch) | |
tree | 9bb35bf5e955c287ccf4a81cfab8b8c1b2a3f82b /spec/serializers/activitypub/update_poll_serializer_spec.rb | |
parent | 20b80c62ff9b8e31a9a35a3d827fcd4c9b68248b (diff) |
Rename ActivityPub Serializer Specs (#23844)
Diffstat (limited to 'spec/serializers/activitypub/update_poll_serializer_spec.rb')
-rw-r--r-- | spec/serializers/activitypub/update_poll_serializer_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/serializers/activitypub/update_poll_serializer_spec.rb b/spec/serializers/activitypub/update_poll_serializer_spec.rb new file mode 100644 index 000000000..4360808b5 --- /dev/null +++ b/spec/serializers/activitypub/update_poll_serializer_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe ActivityPub::UpdatePollSerializer do + subject { JSON.parse(@serialization.to_json) } + + let(:account) { Fabricate(:account) } + let(:poll) { Fabricate(:poll, account: account) } + let!(:status) { Fabricate(:status, account: account, poll: poll) } + + before(:each) do + @serialization = ActiveModelSerializers::SerializableResource.new(status, serializer: ActivityPub::UpdatePollSerializer, adapter: ActivityPub::Adapter) + end + + it 'has a Update type' do + expect(subject['type']).to eql('Update') + end + + it 'has an object with Question type' do + expect(subject['object']['type']).to eql('Question') + end + + it 'has the correct actor URI set' do + expect(subject['actor']).to eql(ActivityPub::TagManager.instance.uri_for(account)) + end +end |