mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-25 05:23:36 -04:00
Make it possible to set a site setting to empty string
This commit is contained in:
parent
811a0df68b
commit
82b5f57e40
2 changed files with 5 additions and 5 deletions
app/controllers/admin
spec/controllers/admin
|
@ -7,7 +7,7 @@ class Admin::SiteSettingsController < Admin::AdminController
|
|||
end
|
||||
|
||||
def update
|
||||
params.require(:value)
|
||||
raise ActionController::ParameterMissing.new(:value) unless params.has_key?(:value)
|
||||
SiteSetting.send("#{params[:id]}=", params[:value])
|
||||
render nothing: true
|
||||
end
|
||||
|
|
|
@ -34,10 +34,10 @@ describe Admin::SiteSettingsController do
|
|||
xhr :put, :update, id: 'test_setting', value: 'hello'
|
||||
end
|
||||
|
||||
# it 'allows value to be a blank string' do
|
||||
# SiteSetting.expects(:'test_setting=').with('').once
|
||||
# xhr :put, :update, id: 'test_setting', value: ''
|
||||
# end
|
||||
it 'allows value to be a blank string' do
|
||||
SiteSetting.expects(:'test_setting=').with('').once
|
||||
xhr :put, :update, id: 'test_setting', value: ''
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue