Merge branch '1092-no-pic-select' of https://github.com/gandaro/diaspora

This commit is contained in:
MrZYX 2011-05-27 19:35:39 +02:00
commit 54f1effdf8
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