Fixes #3054 - "Get latest translations" update all but latest locales

This commit is contained in:
Mantas Masalskis 2020-05-14 15:30:36 +02:00 committed by Thorsten Eckel
parent 163dbc4e9e
commit 4d17b78181
2 changed files with 19 additions and 1 deletions

View file

@ -175,7 +175,7 @@ class Index extends App.ControllerSubContent
success: =>
loader.update(locale.name, false)
locale = locales.shift()
if _.isEmpty(locales)
if !locale
hide()
return
@_syncChanges(locale, locales, loader, hide)

View file

@ -0,0 +1,18 @@
require 'rails_helper'
RSpec.describe 'System > Translations', type: :system do
prepend_before do
Locale.where.not(locale: %w[en-us de-de]).destroy_all # remove all but 2 locales for quicker test
end
it 'when clicking "Get latest translations" fetches all translations' do
visit 'system/translation'
expect(Translation).to receive(:load).with('de-de').and_return(true)
expect(Translation).to receive(:load).with('en-us').and_return(true)
click '.js-syncChanges'
modal_ready && modal_disappear # make sure test is not terminated while modal is visible
end
end