Modify photos unless condition and loop through thumbnails and test

This commit is contained in:
carolina 2013-08-18 23:37:20 +02:00 committed by mokus
parent fd05d30f20
commit f3817b996e
2 changed files with 3 additions and 4 deletions

View file

@ -45,13 +45,12 @@
=t('.born')
= birthday_format(person.birthday)
%li
- unless @photos.blank?
- if @photos.present?
%h4
= t('_photos')
.item_count
= "#{@photos.count}"
- @thumbs = @photos.limit(3)
- for photo in @thumbs
- @photos.limit(3).each do |photo|
= image_tag(photo.url(:thumb_small))
%br
= link_to t('layouts.header.view_all'), person_photos_path(person)

View file

@ -15,8 +15,8 @@ Feature: show photos
And I press "Share"
Scenario: see my own photos
And I am on "robert@grimm.grimm"'s page
When I follow "View all"
And I am on "robert@grimm.grimm"'s page
Then I should be on person_photos page
Scenario: I cannot see photos of people who don't share with me