about summary refs log tree commit diff
path: root/spec/workers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-05 12:43:28 +0100
committerGitHub <noreply@github.com>2019-01-05 12:43:28 +0100
commita49d43d1121ac10f96d5a9cbf78112c707e7a59e (patch)
treeee311cf3d68d695f6cc6c69ce9e1b01c6ad4aeb4 /spec/workers
parentb17b2f25acc4d0cd4284835f28364451cb2fcd88 (diff)
Add scheduled statuses (#9706)
Fix #340
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/publish_scheduled_status_worker_spec.rb23
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