Have pick_avatar return json.

I'm working on writing a test in the discourse_api gem for uploading
avatars and the pick method needs to return a json response.

I also added a test to make sure json is returned.
Good point. I'll remove it.

On Saturday, December 6, 2014, Régis Hanol <notifications@github.com> wrote:

> In spec/controllers/users_controller_spec.rb:
>
> > @@ -1292,6 +1292,19 @@ def post_user
> >          response.should be_success
> >        end
> >
> > +      it 'returns JSON' do
>
> This test is basically useless since the other one parsing JSON.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/discourse/discourse/pull/3024/files#r21417111>.
>