mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Merge pull request #3024 from oblakeerickson/avatar_return_json
Have pick_avatar return json.
This commit is contained in:
commit
dec881ac9d
2 changed files with 8 additions and 1 deletions
|
@ -500,7 +500,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
user.save!
|
user.save!
|
||||||
|
|
||||||
render nothing: true
|
render json: success_json
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_user_image
|
def destroy_user_image
|
||||||
|
|
|
@ -1292,6 +1292,13 @@ describe UsersController do
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'returns success' do
|
||||||
|
xhr :put, :pick_avatar, username: user.username, upload_id: 111
|
||||||
|
user.reload.uploaded_avatar_id.should == 111
|
||||||
|
response.should be_success
|
||||||
|
json = ::JSON.parse(response.body)
|
||||||
|
json['success'].should == "OK"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue