mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: 1868 Security: Dangerous Send
This commit is contained in:
@ -25,6 +25,10 @@ describe Admin::SiteSettingsController do
|
||||
|
||||
context 'update' do
|
||||
|
||||
before do
|
||||
SiteSetting.setting(:test_setting, "default")
|
||||
end
|
||||
|
||||
it 'sets the value when the param is present' do
|
||||
SiteSetting.expects(:'test_setting=').with('hello').once
|
||||
xhr :put, :update, id: 'test_setting', test_setting: 'hello'
|
||||
@ -41,6 +45,12 @@ describe Admin::SiteSettingsController do
|
||||
StaffActionLogger.any_instance.expects(:log_site_setting_change).with('test_setting', 'previous', 'hello')
|
||||
xhr :put, :update, id: 'test_setting', test_setting: 'hello'
|
||||
end
|
||||
|
||||
it 'fails when a setting does not exist' do
|
||||
expect {
|
||||
xhr :put, :update, id: 'provider', provider: 'gotcha'
|
||||
}.to raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user