0
0
Fork 0

Update rubocop and rubocop-rspec (#26329)

This commit is contained in:
Nick Schonning 2023-08-22 03:31:40 -04:00 committed by GitHub
parent fe31571965
commit b970ed6098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 48 additions and 74 deletions

View file

@ -16,8 +16,7 @@ describe Api::V1::Instances::TranslationLanguagesController do
context 'when a translation service is configured' do
before do
service = instance_double(TranslationService::DeepL, languages: { nil => %w(en de), 'en' => ['de'] })
allow(TranslationService).to receive(:configured?).and_return(true)
allow(TranslationService).to receive(:configured).and_return(service)
allow(TranslationService).to receive_messages(configured?: true, configured: service)
end
it 'returns language matrix' do

View file

@ -20,8 +20,7 @@ describe Api::V1::Statuses::TranslationsController do
before do
translation = TranslationService::Translation.new(text: 'Hello')
service = instance_double(TranslationService::DeepL, translate: [translation])
allow(TranslationService).to receive(:configured?).and_return(true)
allow(TranslationService).to receive(:configured).and_return(service)
allow(TranslationService).to receive_messages(configured?: true, configured: service)
Rails.cache.write('translation_service/languages', { 'es' => ['en'] })
post :create, params: { status_id: status.id }
end