@@ -59,22 +59,23 @@ def expect_google_translate(text)
5959 end
6060
6161 it "does not backfill if backfill limit is set to 0" do
62+ SiteSetting . automatic_translation_backfill_maximum_translations_per_hour = 1
6263 SiteSetting . automatic_translation_target_languages = "de"
6364 SiteSetting . automatic_translation_backfill_maximum_translations_per_hour = 0
6465 expect_any_instance_of ( Jobs ::AutomaticTranslationBackfill ) . not_to receive ( :process_batch )
6566 end
6667
6768 it "does not backfill if backfill lock is not secure" do
68- SiteSetting . automatic_translation_target_languages = "de"
6969 SiteSetting . automatic_translation_backfill_maximum_translations_per_hour = 1
70+ SiteSetting . automatic_translation_target_languages = "de"
7071 Discourse . redis . set ( "discourse_translator_backfill_lock" , "1" )
7172 expect_any_instance_of ( Jobs ::AutomaticTranslationBackfill ) . not_to receive ( :translate_records )
7273 end
7374
7475 describe "with two locales ['de', 'es']" do
7576 before do
76- SiteSetting . automatic_translation_target_languages = "de|es"
7777 SiteSetting . automatic_translation_backfill_maximum_translations_per_hour = 100
78+ SiteSetting . automatic_translation_target_languages = "de|es"
7879 expect_google_check_language
7980 end
8081
@@ -107,8 +108,8 @@ def expect_google_translate(text)
107108
108109 describe "with just one locale ['de']" do
109110 before do
110- SiteSetting . automatic_translation_target_languages = "de"
111111 SiteSetting . automatic_translation_backfill_maximum_translations_per_hour = 5 * 12
112+ SiteSetting . automatic_translation_target_languages = "de"
112113 expect_google_check_language
113114 end
114115
0 commit comments