From 5cdeed6c54c5916f329d8a75b1b2d46e3a77fb15 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 2 Nov 2010 17:10:19 -0700 Subject: [PATCH 1/2] Add a spec to people_controller, make those specs a little clearer --- app/controllers/people_controller.rb | 1 + spec/controllers/people_controller_spec.rb | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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/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 From a995d250f10cb170f25a18f96d7384ee549a9faf Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 2 Nov 2010 17:19:49 -0700 Subject: [PATCH 2/2] added white text on grey asset to mailer --- app/mailers/notifier.rb | 4 ++-- app/views/notifier/new_request.html.haml | 2 +- app/views/notifier/request_accepted.html.haml | 2 +- public/images/diaspora_white_on_grey.png | Bin 0 -> 1112 bytes 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 public/images/diaspora_white_on_grey.png 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 0000000000000000000000000000000000000000..6213e06712dd37b1c841e55ef4dc7bd85d1e778f GIT binary patch literal 1112 zcmeAS@N?(olHy`uVBq!ia0y~yV2S{;H8_}oq$q0%8<0u}@Ck8c0|PNIPzM8JFmMNh za4^UKgUYH(AZi1HX<)Dd47P*8@#Dv@U%&qH<;(BizcX|*OkkMGFpFV6!;-*rC9@b9 zm^XX6IEGZrc{?k+`>BS2gR6^+3X9;zHUIzHUr)dC<*d%>ZC`wroonCcsq^}qD!cqt z15W|z1pB}I0`FUnC~b2{5{y>Z*r7Wi;)s}sP7=3@*hW^N?i);Cx7AVWfwjOMfe9^joVkXZ1ME1k*zD9Pq@Npr&^K_`{Dk- z#~t$@>rFeMq8+m4@)ZH^g%%5rw=S7DrRnOs6Y8>(ymc_>Ocb0iRd@GbRYqq!3ylL^DE!_Wn{NuDHsOUw~%!qfp^NJOc-49&I_P;A7 zJz4u-*hH(pGD(Y`&KKgk^eWb-TXnji_6;Mx!i-x_qMF{eYMW?H47u#dZ#^}{cwJw_ zy;O$ZQ_B54_H?IjqFVC=E^g6$pX~I=)~0Lgm5n0vWaXDt z#2uHOl5^!@YrNNsd*-({MZC%IUbVdCNOXk=cTMJ|wX=>^IQJZCJmbIi^Zlojo)lJH zs<~oX#h)1N_+L@+qmbN@OALE@OhVU~Gsrb<>Y~#62 zd%F+5`c|nk&KUM&1{pU2l3Yi5GwwLi?9+X9^K-%vLO78MMhu6{1- HoD!M<)j#{z literal 0 HcmV?d00001