diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index ea56ed81b..9280e2d3e 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -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" } diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index c0626f387..3e90576f1 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -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]) diff --git a/app/views/notifier/new_request.html.haml b/app/views/notifier/new_request.html.haml index 66bb56f1a..d87a7c387 100644 --- a/app/views/notifier/new_request.html.haml +++ b/app/views/notifier/new_request.html.haml @@ -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}! diff --git a/app/views/notifier/request_accepted.html.haml b/app/views/notifier/request_accepted.html.haml index 191f8f42c..f3359e6ac 100644 --- a/app/views/notifier/request_accepted.html.haml +++ b/app/views/notifier/request_accepted.html.haml @@ -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}! diff --git a/public/images/diaspora_white_on_grey.png b/public/images/diaspora_white_on_grey.png new file mode 100644 index 000000000..6213e0671 Binary files /dev/null and b/public/images/diaspora_white_on_grey.png differ diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index 16b0968a4..c69c0f9d5 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -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