mirror of
https://ghfast.top/https://github.com/discourse/discourse-translator.git
synced 2026-07-18 11:59:35 +08:00
Users are allowed to set `automatic translation target languages`, but the automatic translation depends on `automatic_translation_backfill_maximum_translations_per_hour`, and the latter is a hidden site setting defaulting to zero. It is not obvious that these settings are related. This commit ensures users are informed that this needs to be set as well.
27 lines
761 B
Ruby
27 lines
761 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe "Translation settings", type: :system do
|
|
fab!(:admin)
|
|
|
|
before do
|
|
sign_in(admin)
|
|
SiteSetting.translator_enabled = true
|
|
end
|
|
|
|
it "warns when automatic_translation_target_languages is being set but backfill limit is 0" do
|
|
visit(
|
|
"/admin/plugins/discourse-translator/settings?filter=automatic%20translation%20target%20languages",
|
|
)
|
|
|
|
setting =
|
|
PageObjects::Components::SelectKit.new(
|
|
"[data-setting='automatic_translation_target_languages'] .select-kit",
|
|
)
|
|
setting.expand
|
|
setting.select_row_by_value("ja")
|
|
|
|
page.find(".setting-controls button.ok").click()
|
|
|
|
expect(page).to have_content(I18n.t("site_settings.errors.needs_nonzero_backfill"))
|
|
end
|
|
end
|