logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

media_cleanup_scheduler_spec.rb (481B)


  1. require 'rails_helper'
  2. describe Scheduler::MediaCleanupScheduler do
  3. subject { described_class.new }
  4. let!(:old_media) { Fabricate(:media_attachment, account_id: nil, created_at: 10.days.ago) }
  5. let!(:new_media) { Fabricate(:media_attachment, account_id: nil, created_at: 1.hour.ago) }
  6. it 'removes old media records' do
  7. subject.perform
  8. expect { old_media.reload }.to raise_error(ActiveRecord::RecordNotFound)
  9. expect(new_media.reload).to be_persisted
  10. end
  11. end