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.
24 lines
580 B
24 lines
580 B
6 years ago
|
# frozen_string_literal: true
|
||
|
|
||
|
require 'rails_helper'
|
||
|
|
||
|
describe PublishScheduledStatusWorker do
|
||
|
subject { described_class.new }
|
||
|
|
||
|
let(:scheduled_status) { Fabricate(:scheduled_status, params: { text: 'Hello world, future!' }) }
|
||
|
|
||
|
describe 'perform' do
|
||
|
before do
|
||
|
subject.perform(scheduled_status.id)
|
||
|
end
|
||
|
|
||
|
it 'creates a status' do
|
||
|
expect(scheduled_status.account.statuses.first.text).to eq 'Hello world, future!'
|
||
|
end
|
||
|
|
||
|
it 'removes the scheduled status' do
|
||
|
expect(ScheduledStatus.find_by(id: scheduled_status.id)).to be_nil
|
||
|
end
|
||
|
end
|
||
|
end
|