diff --git a/app/helpers/profiles_helper.rb b/app/helpers/profiles_helper.rb index 941c8058e..31c8a16d7 100644 --- a/app/helpers/profiles_helper.rb +++ b/app/helpers/profiles_helper.rb @@ -29,6 +29,10 @@ module ProfilesHelper # @param [Profile, Symbol] Profile and field in question # @return [Boolean] The field in question is set? def field_filled_out?(profile, field) - profile.send("#{field}".to_sym).present? + if field != :image_url + profile.send("#{field}".to_sym).present? + else + profile.send("#{field}".to_sym) != "/images/user/default.png" + end end end diff --git a/spec/helpers/profiles_helper.rb b/spec/helpers/profiles_helper.rb index 27f59ae3a..ce15f2613 100644 --- a/spec/helpers/profiles_helper.rb +++ b/spec/helpers/profiles_helper.rb @@ -17,6 +17,15 @@ describe ProfilesHelper do @profile.bio = "abc" field_filled_out?(@profile, :bio).should be_true end + + it 'returns false if default profile photo is used' do + field_filled_out?(@profile, :image_url).should be_false + end + + it 'returns true if custom profile photo is set' do + @profile.image_url = "abc.jpg" + field_filled_out?(@profile, :image_url).should be_true + end end describe '#profile_field_tag' do