Fixed issue#502 - "Get latest Translations" fails(?) without error.

This commit is contained in:
Martin Edenhofer 2016-12-05 12:25:41 +01:00
parent ccab0ea4fc
commit 0c2be657be
2 changed files with 61 additions and 2 deletions

View file

@ -164,13 +164,15 @@ class Index extends App.ControllerSubContent
type: 'GET' type: 'GET'
url: "#{@apiPath}/translations/sync/#{locale.locale}" url: "#{@apiPath}/translations/sync/#{locale.locale}"
processData: false processData: false
complete: (data, status, xhr) => success: =>
loader.update(locale.name, false) loader.update(locale.name, false)
locale = locales.shift() locale = locales.shift()
if _.isEmpty(locales) if _.isEmpty(locales)
hide() hide()
return return
@_syncChanges(locale, locales, loader, hide) @_syncChanges(locale, locales, loader, hide)
error: ->
hide()
) )
updateOnServer: (params, event) => updateOnServer: (params, event) =>

View file

@ -2,6 +2,7 @@
require 'browser_test_helper' require 'browser_test_helper'
class TranslationTest < TestCase class TranslationTest < TestCase
def test_preferences def test_preferences
@browser = browser_instance @browser = browser_instance
login( login(
@ -250,4 +251,60 @@ class TranslationTest < TestCase
) )
end end
def test_admin_sync
@browser = browser_instance
login(
username: 'master@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
select(
css: '.language_item [name="locale"]',
value: 'Deutsch',
)
click(css: '.content.active button[type="submit"]')
watch_for(
css: 'body',
value: 'Sprache',
)
click(css: 'a[href="#manage"]')
click(css: 'a[href="#system/translation"]')
watch_for(
css: '.content.active',
value: 'Inline Übersetzung',
)
click(css: '.content.active .js-syncChanges')
watch_for(
css: '.content.active .modal',
value: 'Letzte Übersetzung laden',
)
watch_for_disappear(
css: '.content.active .modal',
timeout: 5 * 60,
)
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
select(
css: '.language_item [name="locale"]',
value: 'English (United States)',
)
click(css: '.content.active button[type="submit"]')
watch_for(
css: 'body',
value: 'Language',
)
end
end end