mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: enforce 'allow_uploaded_avatars' & 'sso_overrides_avatar' server-side
This commit is contained in:
parent
069516f4b4
commit
16f509afb9
4 changed files with 40 additions and 0 deletions
|
@ -106,6 +106,18 @@ describe UploadsController do
|
|||
expect(message.data["errors"]).to be
|
||||
end
|
||||
|
||||
it 'ensures allow_uploaded_avatars is enabled when uploading an avatar' do
|
||||
SiteSetting.stubs(:allow_uploaded_avatars).returns(false)
|
||||
xhr :post, :create, file: logo, type: "avatar"
|
||||
expect(response).to_not be_success
|
||||
end
|
||||
|
||||
it 'ensures sso_overrides_avatar is not enabled when uploading an avatar' do
|
||||
SiteSetting.stubs(:sso_overrides_avatar).returns(true)
|
||||
xhr :post, :create, file: logo, type: "avatar"
|
||||
expect(response).to_not be_success
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue