fixes bug #1092
This commit is contained in:
parent
307b69c7cf
commit
0efaa77c46
3 changed files with 16 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue