mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Fix SiteSetingExtension
specs to coerce int to string.
This commit is contained in:
@ -284,6 +284,8 @@ module SiteSettingExtension
|
|||||||
def add_override!(name, val)
|
def add_override!(name, val)
|
||||||
type = get_data_type(name, defaults[name.to_sym])
|
type = get_data_type(name, defaults[name.to_sym])
|
||||||
|
|
||||||
|
val = val.to_s if type == types[:string]
|
||||||
|
|
||||||
if type == types[:bool] && val != true && val != false
|
if type == types[:bool] && val != true && val != false
|
||||||
val = (val == "t" || val == "true") ? 't' : 'f'
|
val = (val == "t" || val == "true") ? 't' : 'f'
|
||||||
end
|
end
|
||||||
|
@ -179,7 +179,6 @@ describe SiteSettingExtension do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "should coerce int to string" do
|
it "should coerce int to string" do
|
||||||
skip "This test is not working on Rspec 2 even"
|
|
||||||
settings.test_str = 100
|
settings.test_str = 100
|
||||||
expect(settings.test_str).to eq("100")
|
expect(settings.test_str).to eq("100")
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user