diff options
author | ThibG <thib@sitedethib.com> | 2019-01-11 10:53:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-11 10:53:58 +0100 |
commit | 2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (patch) | |
tree | c57169b5a3d717f4e68b8ec5d2d6e220d1456434 /spec/workers | |
parent | d1da0a1086fa25f22739277fbf32ba1b3745317d (diff) | |
parent | 394525e32994e605093c87d3a9fad2a4202f3401 (diff) |
Merge pull request #885 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/publish_scheduled_status_worker_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/workers/publish_scheduled_status_worker_spec.rb b/spec/workers/publish_scheduled_status_worker_spec.rb new file mode 100644 index 000000000..f8547e6fe --- /dev/null +++ b/spec/workers/publish_scheduled_status_worker_spec.rb @@ -0,0 +1,23 @@ +# 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 |