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

This commit is contained in:
maxwell 2010-11-02 17:33:18 -07:00
commit 7e1ee9f371
6 changed files with 16 additions and 6 deletions

View file

@ -56,6 +56,7 @@ class PeopleController < ApplicationController
end
# upload and set new profile photo
params[:person][:profile] ||= {}
if params[:person][:profile][:image].present?
raw_image = params[:person][:profile].delete(:image)
params[:profile_image_hash] = { :user_file => raw_image, :to => "all" }

View file

@ -2,12 +2,12 @@ class Notifier < ActionMailer::Base
include Magent::Async
default :from => "no-reply@joindiaspora.com"
ATTACHMENT = File.read("#{Rails.root}/public/images/diaspora_caps.png")
ATTACHMENT = File.read("#{Rails.root}/public/images/diaspora_white_on_grey.png")
def new_request(recipient, sender)
@receiver = recipient
@sender = sender
attachments["diaspora_white.png"] = ATTACHMENT
attachments["diaspora_white_on_grey.png"] = ATTACHMENT
mail(:to => "#{recipient.real_name} <#{recipient.email}>",
:subject => "new Diaspora* friend request from #{@sender.real_name}", :host => APP_CONFIG[:terse_pod_url])

View file

@ -43,7 +43,7 @@
}
%body
%header
= image_tag 'diaspora_white.png'
= image_tag attachments['diaspora_white_on_grey.png'], :alt => "DIASPORA"
#container
%p
Hello #{@receiver.profile.first_name}!

View file

@ -43,7 +43,7 @@
}
%body
%header
= image_tag 'diaspora_white.png'
= image_tag attachments['diaspora_white_on_grey.png'], :alt => "DIASPORA"
#container
%p
Hello #{@receiver.profile.first_name}!

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -22,14 +22,17 @@ describe PeopleController do
it 'should go to the current_user show page' do
get :show, :id => user.person.id
response.should be_success
end
it "doesn't error out on an invalid id" do
it "redirects on an invalid id" do
get :show, :id => 'delicious'
response.should redirect_to people_path
end
it "doesn't error out on a nonexistent person" do
it "redirects on a nonexistent person" do
get :show, :id => user.id
response.should redirect_to people_path
end
describe '#update' do
@ -50,5 +53,11 @@ describe PeopleController do
user.person.profile.image_url.should == image_url
end
end
it 'does not allow mass assignment' do
new_user = make_user
put :update, :id => user.person.id, :person => {
:owner_id => new_user.id}
user.person.reload.owner_id.should_not == new_user.id
end
end
end