mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 04:42:51 +08:00
18 lines
543 B
Ruby
18 lines
543 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
RSpec.describe OneboxLocaleSiteSetting do
|
||
|
describe ".valid_value?" do
|
||
|
it "returns true for a locale that we have translations for" do
|
||
|
expect(OneboxLocaleSiteSetting.valid_value?("en")).to eq(true)
|
||
|
end
|
||
|
|
||
|
it "returns true for an empty value" do
|
||
|
expect(OneboxLocaleSiteSetting.valid_value?("")).to eq(true)
|
||
|
end
|
||
|
|
||
|
it "returns false for a locale that we do not have translations for" do
|
||
|
expect(OneboxLocaleSiteSetting.valid_value?("swedish-chef")).to eq(false)
|
||
|
end
|
||
|
end
|
||
|
end
|