You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
643 B

  1. require 'rails_helper'
  2. RSpec.describe FollowRequest, type: :model do
  3. describe '#authorize!' do
  4. let(:follow_request) { Fabricate(:follow_request, account: account, target_account: target_account) }
  5. let(:account) { Fabricate(:account) }
  6. let(:target_account) { Fabricate(:account) }
  7. it 'calls Account#follow!, MergeWorker.perform_async, and #destroy!' do
  8. expect(account).to receive(:follow!).with(target_account)
  9. expect(MergeWorker).to receive(:perform_async).with(target_account.id, account.id)
  10. expect(follow_request).to receive(:destroy!)
  11. follow_request.authorize!
  12. end
  13. end
  14. end