mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
fix the build - take 2
This commit is contained in:
@ -1301,7 +1301,7 @@ describe UsersController do
|
||||
describe '.pick_avatar' do
|
||||
|
||||
it 'raises an error when not logged in' do
|
||||
expect { xhr :put, :pick_avatar, username: 'asdf', avatar_id: 1}.to raise_error(Discourse::NotLoggedIn)
|
||||
expect { xhr :put, :pick_avatar, username: 'asdf', avatar_id: 1, type: "custom"}.to raise_error(Discourse::NotLoggedIn)
|
||||
end
|
||||
|
||||
context 'while logged in' do
|
||||
@ -1310,12 +1310,12 @@ describe UsersController do
|
||||
|
||||
it 'raises an error when you don\'t have permission to toggle the avatar' do
|
||||
another_user = Fabricate(:user)
|
||||
xhr :put, :pick_avatar, username: another_user.username, upload_id: 1
|
||||
xhr :put, :pick_avatar, username: another_user.username, upload_id: 1, type: "custom"
|
||||
expect(response).to be_forbidden
|
||||
end
|
||||
|
||||
it 'it successful' do
|
||||
xhr :put, :pick_avatar, username: user.username, upload_id: 111
|
||||
xhr :put, :pick_avatar, username: user.username, upload_id: 111, type: "custom"
|
||||
expect(user.reload.uploaded_avatar_id).to eq(111)
|
||||
expect(user.user_avatar.reload.custom_upload_id).to eq(111)
|
||||
expect(response).to be_success
|
||||
@ -1326,13 +1326,6 @@ describe UsersController do
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it 'returns success' do
|
||||
xhr :put, :pick_avatar, username: user.username, upload_id: 111
|
||||
expect(user.reload.uploaded_avatar_id).to eq(111)
|
||||
expect(response).to be_success
|
||||
json = ::JSON.parse(response.body)
|
||||
expect(json['success']).to eq("OK")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user