mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 07:23:30 +08:00
Related: https://meta.discourse.org/t/feature-request-make-it-possible-to-translate-custom-sidebar-links-and-sections/299871 Custom sidebar sections can be translated manually or with AI.
15 lines
532 B
Ruby
Vendored
15 lines
532 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
describe SidebarSectionLocalization do
|
|
it "enforces one localization per sidebar section and locale" do
|
|
sidebar_section = Fabricate(:sidebar_section)
|
|
Fabricate(:sidebar_section_localization, sidebar_section:, locale: "ja")
|
|
|
|
localization = Fabricate.build(:sidebar_section_localization, sidebar_section:, locale: "ja")
|
|
|
|
expect(localization).not_to be_valid
|
|
expect(localization.errors.details[:sidebar_section_id]).to contain_exactly(
|
|
include(error: :taken),
|
|
)
|
|
end
|
|
end
|