This commit is contained in:
Jakob Kramer 2011-05-26 20:50:42 +02:00
parent 307b69c7cf
commit 0efaa77c46
3 changed files with 16 additions and 1 deletions

View file

@ -215,6 +215,10 @@ class Person < ActiveRecord::Base
def to_twitter(format=:json)
end
def has_photos?
self.posts.where(:type => "Photo").exists?
end
protected
def clean_url

View file

@ -13,7 +13,7 @@
%p
#fileInfo
-if !aspect.nil? && aspect != :getting_started
-if !aspect.nil? && aspect != :getting_started && current_user.person.has_photos?
%br
%br
%p

View file

@ -374,4 +374,15 @@ describe Person do
end
end
end
describe '#has_photos?' do
it 'returns false if the user has no photos' do
alice.person.has_photos?.should be_false
end
it 'returns true if the user has photos' do
alice.post(:photo, :user_file => uploaded_photo, :to => alice.aspects.first.id)
alice.person.has_photos?.should be_true
end
end
end