2021-06-01 15:11:48 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 21:27:38 -05:00
|
|
|
RSpec.describe TrustLevelSetting do
|
2021-06-01 15:11:48 -05:00
|
|
|
describe ".values" do
|
2023-01-09 05:18:21 -06:00
|
|
|
after { I18n.reload! }
|
2021-06-07 22:13:38 -05:00
|
|
|
|
2021-06-01 15:11:48 -05:00
|
|
|
it "returns translated names" do
|
|
|
|
TranslationOverride.upsert!(I18n.locale, "js.trust_levels.names.newuser", "New Member")
|
|
|
|
|
|
|
|
value = TrustLevelSetting.values.first
|
2023-01-09 05:18:21 -06:00
|
|
|
expect(value[:name]).to eq(
|
|
|
|
I18n.t("js.trust_levels.detailed_name", level: 0, name: "New Member"),
|
|
|
|
)
|
2021-06-01 15:11:48 -05:00
|
|
|
expect(value[:value]).to eq(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|