about summary refs log tree commit diff
path: root/spec/services/update_status_service_spec.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-29 16:39:43 +0200
committerGitHub <noreply@github.com>2022-03-29 16:39:43 +0200
commiteaea849035ea407afb2d5db411dbddc1ccca6f44 (patch)
tree19a0b6e761fc453fac2f5a8aba24595ad93f0382 /spec/services/update_status_service_spec.rb
parent2287eebae0c1d699436a8cf3218d7cfe990a3605 (diff)
parent8d6f3f8a379c8d552d2101cf35ae8f6fe956da53 (diff)
Merge pull request #1724 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/services/update_status_service_spec.rb')
-rw-r--r--spec/services/update_status_service_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/update_status_service_spec.rb b/spec/services/update_status_service_spec.rb
index 78cc89cd4..71a73be5b 100644
--- a/spec/services/update_status_service_spec.rb
+++ b/spec/services/update_status_service_spec.rb
@@ -3,6 +3,23 @@ require 'rails_helper'
 RSpec.describe UpdateStatusService, type: :service do
   subject { described_class.new }
 
+  context 'when nothing changes' do
+    let!(:status) { Fabricate(:status, text: 'Foo', language: 'en') }
+
+    before do
+      allow(ActivityPub::DistributionWorker).to receive(:perform_async)
+      subject.call(status, status.account_id, text: 'Foo')
+    end
+
+    it 'does not create an edit' do
+      expect(status.reload.edits).to be_empty
+    end
+
+    it 'does not notify anyone' do
+      expect(ActivityPub::DistributionWorker).to_not have_received(:perform_async)
+    end
+  end
+
   context 'when text changes' do
     let!(:status) { Fabricate(:status, text: 'Foo') }
     let(:preview_card) { Fabricate(:preview_card) }