mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
add image authorization on upload_avatar
This commit is contained in:
@ -966,6 +966,12 @@ describe UsersController do
|
||||
response.status.should eq 413
|
||||
end
|
||||
|
||||
it 'rejects unauthorized images' do
|
||||
SiteSetting.stubs(:authorized_image?).returns(false)
|
||||
xhr :post, :upload_avatar, username: user.username, file: avatar
|
||||
response.status.should eq 422
|
||||
end
|
||||
|
||||
it 'is successful' do
|
||||
upload = Fabricate(:upload)
|
||||
Upload.expects(:create_for).returns(upload)
|
||||
|
Reference in New Issue
Block a user