0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/plugins/discourse-ai/spec/jobs/scheduled/sidebar_localization_backfill_spec.rb
Natalie Tay 7c89948f1a
UX: Convert AI translation's max days ago setting to a specific date setting instead (#42082)
Related:
https://meta.discourse.org/t/request-for-a-date-picker-in-ai-translate-settings/405828

The backfill translation setting was "max age days". This resulted in a
running date, which meant the older topics couldn't get updated if the
date keeps running from today.
2026-07-28 18:27:34 +08:00

25 lines
749 B
Ruby
Vendored

# frozen_string_literal: true
describe Jobs::SidebarLocalizationBackfill do
before do
enable_current_plugin
assign_fake_provider_to(:ai_default_llm_model)
SiteSetting.ai_translation_enabled = true
SiteSetting.ai_translation_backfill_hourly_rate = 100
SiteSetting.content_localization_supported_locales = "pt_BR|zh_CN"
end
it "does not enqueue when AI is disabled" do
SiteSetting.discourse_ai_enabled = false
described_class.new.execute({})
expect_not_enqueued_with(job: :localize_sidebar_sections)
end
it "enqueues localize_sidebar_sections job with the hourly rate limit" do
described_class.new.execute({})
expect_job_enqueued(job: :localize_sidebar_sections, args: { limit: 100 })
end
end