Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
maxwell 2010-10-29 15:16:17 -07:00
commit a272b22208
4 changed files with 23 additions and 3 deletions

View file

@ -73,12 +73,12 @@ class PeopleController < ApplicationController
private
def prep_image_url(params)
if params[:profile] && params[:profile][:image_url]
url = APP_CONFIG[:pod_url].dup
url.chop! if APP_CONFIG[:pod_url][-1,1] == '/'
if params[:profile][:image_url].empty?
params[:profile].delete(:image_url)
else
if /^http:\/\// =~ params[:profile][:image_url]
url = APP_CONFIG[:pod_url].dup
url.chop! if APP_CONFIG[:pod_url][-1,1] == '/'
if params[:profile][:image_url].match(/^https?:\/\//)
params[:profile][:image_url] = params[:profile][:image_url]
else
params[:profile][:image_url] = url + params[:profile][:image_url]

View file

@ -30,6 +30,10 @@
- if @person != current_user.person && current_user.friends.include?(@person)
= link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button"
- if @person == current_user.person
%b
= link_to "Edit my profile", edit_person_path(@person)
%br
%br
%ul

View file

@ -262,6 +262,7 @@ header
:position absolute
:top 7px
:left 0
:-webkit-box-shadow 0 1px 2px #666
h2
:margin

View file

@ -46,8 +46,23 @@ describe PeopleController do
image_url = user.person.profile.image_url
put("update", :id => user.person.id, "person" => params)
user.person.reload
user.person.profile.image_url.should == image_url
end
it "doesn't prepend (https?://) if already present in image_url" do
params = {:profile=>
{:image_url => "https://google.com/image.png",
:last_name => user.person.profile.last_name,
:first_name => user.person.profile.first_name}}
put("update", :id => user.person.id, "person" => params)
user.person.reload
user.person.profile.image_url.should == params[:profile][:image_url]
end
end
end
end