Fixes #3054 - "Get latest translations" update all but latest locales
This commit is contained in:
parent
163dbc4e9e
commit
4d17b78181
2 changed files with 19 additions and 1 deletions
|
@ -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)
|
||||
|
|
18
spec/system/system/translations_spec.rb
Normal file
18
spec/system/system/translations_spec.rb
Normal 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
|
Loading…
Reference in a new issue