Use a more helpful failure message in spec
This commit is contained in:
parent
30619c244c
commit
fd931b948d
|
@ -23,11 +23,13 @@ describe "site setting integrity checks" do
|
||||||
|
|
||||||
it "no locale default has different type than default or invalid key" do
|
it "no locale default has different type than default or invalid key" do
|
||||||
yaml.each_value do |category|
|
yaml.each_value do |category|
|
||||||
category.each_value do |setting|
|
category.each do |setting_name, setting|
|
||||||
next unless setting.is_a?(Hash)
|
next unless setting.is_a?(Hash)
|
||||||
if setting['locale_default']
|
if setting['locale_default']
|
||||||
setting['locale_default'].each_pair do |k, v|
|
setting['locale_default'].each_pair do |k, v|
|
||||||
expect(LocaleSiteSetting.valid_value?(k.to_s)).to be_truthy
|
expect(LocaleSiteSetting.valid_value?(k.to_s)).to be_truthy,
|
||||||
|
"'#{k}' is not a valid locale_default key for '#{setting_name}' site setting"
|
||||||
|
|
||||||
case setting['default']
|
case setting['default']
|
||||||
when TrueClass, FalseClass
|
when TrueClass, FalseClass
|
||||||
expect(v.class == TrueClass || v.class == FalseClass).to be_truthy
|
expect(v.class == TrueClass || v.class == FalseClass).to be_truthy
|
||||||
|
|
Loading…
Reference in New Issue