update_poll_serializer_spec.rb 690 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe ActivityPub::UpdatePollSerializer do
  4. subject { serialized_record_json(status, described_class, adapter: ActivityPub::Adapter) }
  5. let(:account) { Fabricate(:account) }
  6. let(:poll) { Fabricate(:poll, account: account) }
  7. let!(:status) { Fabricate(:status, account: account, poll: poll) }
  8. it 'has a Update type' do
  9. expect(subject['type']).to eql('Update')
  10. end
  11. it 'has an object with Question type' do
  12. expect(subject['object']['type']).to eql('Question')
  13. end
  14. it 'has the correct actor URI set' do
  15. expect(subject['actor']).to eql(ActivityPub::TagManager.instance.uri_for(account))
  16. end
  17. end