mirror of
https://github.com/discourse/discourse.git
synced 2025-04-29 05:14:34 +08:00
Make it possible to set a site setting to empty string
This commit is contained in:
parent
811a0df68b
commit
82b5f57e40
@ -7,7 +7,7 @@ class Admin::SiteSettingsController < Admin::AdminController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
params.require(:value)
|
raise ActionController::ParameterMissing.new(:value) unless params.has_key?(:value)
|
||||||
SiteSetting.send("#{params[:id]}=", params[:value])
|
SiteSetting.send("#{params[:id]}=", params[:value])
|
||||||
render nothing: true
|
render nothing: true
|
||||||
end
|
end
|
||||||
|
@ -34,10 +34,10 @@ describe Admin::SiteSettingsController do
|
|||||||
xhr :put, :update, id: 'test_setting', value: 'hello'
|
xhr :put, :update, id: 'test_setting', value: 'hello'
|
||||||
end
|
end
|
||||||
|
|
||||||
# it 'allows value to be a blank string' do
|
it 'allows value to be a blank string' do
|
||||||
# SiteSetting.expects(:'test_setting=').with('').once
|
SiteSetting.expects(:'test_setting=').with('').once
|
||||||
# xhr :put, :update, id: 'test_setting', value: ''
|
xhr :put, :update, id: 'test_setting', value: ''
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user