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.

23 lines
580 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe PublishScheduledStatusWorker do
  4. subject { described_class.new }
  5. let(:scheduled_status) { Fabricate(:scheduled_status, params: { text: 'Hello world, future!' }) }
  6. describe 'perform' do
  7. before do
  8. subject.perform(scheduled_status.id)
  9. end
  10. it 'creates a status' do
  11. expect(scheduled_status.account.statuses.first.text).to eq 'Hello world, future!'
  12. end
  13. it 'removes the scheduled status' do
  14. expect(ScheduledStatus.find_by(id: scheduled_status.id)).to be_nil
  15. end
  16. end
  17. end