Return the "large" image from the user details API call
authorTom Hughes <tom@compton.nu>
Mon, 9 Jul 2018 19:26:37 +0000 (20:26 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 9 Jul 2018 19:26:37 +0000 (20:26 +0100)
Closes #1923

app/helpers/user_helper.rb
app/views/user/api_read.builder
test/helpers/user_helper_test.rb

index 27d6faa8c67c9654dee714ed3e5ea7af8ac95056..065a562c4d282ad977ef51733b9f687a811bf988 100644 (file)
@@ -38,7 +38,7 @@ module UserHelper
     if user.image_use_gravatar
       user_gravatar_url(user, options)
     else
-      image_url(user.image.url)
+      image_url(user.image.url(:large))
     end
   end
 
index 4ed8c9e942018597c7d5540d5f98a773eecf0fa0..e9cebd5aeb0c4c8afb600be344ba27b5f982fa77 100644 (file)
@@ -10,7 +10,7 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do
     else
       xml.tag! "contributor-terms", :agreed => @user.terms_agreed.present?
     end
-    xml.tag! "img", :href => user_image_url(@user, :size => 256) if @user.image.file? || @user.image_use_gravatar
+    xml.tag! "img", :href => user_image_url(@user) if @user.image.file? || @user.image_use_gravatar
     xml.tag! "roles" do
       @user.roles.each do |role|
         xml.tag! role.role
index eedc8775c8aac269a0f4e3fd47ba862dcdce875e..c57299a96d4f3e4db339d710cfc18e078380dabf 100644 (file)
@@ -59,7 +59,7 @@ class UserHelperTest < ActionView::TestCase
     gravatar_user = create(:user, :image_use_gravatar => true)
 
     url = user_image_url(user)
-    assert_match %r{^/attachments/users/images/\d{3}/\d{3}/\d{3}/original/d41d8cd98f00b204e9800998ecf8427e.jpg$}, url
+    assert_match %r{^/attachments/users/images/\d{3}/\d{3}/\d{3}/large/d41d8cd98f00b204e9800998ecf8427e.jpg$}, url
 
     url = user_image_url(gravatar_user)
     assert_match %r{^http://www.gravatar.com/avatar/}, url