discourse/spec/models/onebox_locale_site_setting_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
543 B
Ruby
Raw Normal View History

# 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