about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2023-03-04 17:17:46 -0500
committerGitHub <noreply@github.com>2023-03-04 23:17:46 +0100
commitc599e289d806f6d13e3383879750db053a654821 (patch)
treeb289172e4ecd96f38b6515ba28fa2060401473b0 /spec
parent2d1ccb3d8b9427cdc8ec1e187980458ab8a0890f (diff)
Fix spec for api/v1/statuses/translations (#23956)
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/api/v1/statuses/translations_controller_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/controllers/api/v1/statuses/translations_controller_spec.rb b/spec/controllers/api/v1/statuses/translations_controller_spec.rb
index 9575ac448..2deea9fc0 100644
--- a/spec/controllers/api/v1/statuses/translations_controller_spec.rb
+++ b/spec/controllers/api/v1/statuses/translations_controller_spec.rb
@@ -15,11 +15,12 @@ describe Api::V1::Statuses::TranslationsController do
     end
 
     describe 'POST #create' do
-      let(:status) { Fabricate(:status, account: user.account) }
+      let(:status) { Fabricate(:status, account: user.account, text: 'Hola', language: 'es') }
 
       before do
         translation = TranslationService::Translation.new(text: 'Hello')
-        service = instance_double(TranslationService::DeepL, translate: translation)
+        service = instance_double(TranslationService::DeepL, translate: translation, supported?: true)
+        allow(TranslationService).to receive(:configured?).and_return(true)
         allow(TranslationService).to receive(:configured).and_return(service)
         post :create, params: { status_id: status.id }
       end