From fd05d30f2018a629aefcffdf75205ef4a81a1b53 Mon Sep 17 00:00:00 2001
From: carolina <carolina@sindominio.net>
Date: Mon, 12 Aug 2013 16:00:39 +0200
Subject: [PATCH] Add tests for photo link in profile side bar

---
 features/profile_photos.feature | 27 +++++++++++++++++++++++++++
 features/support/paths.rb       |  2 ++
 2 files changed, 29 insertions(+)
 create mode 100644 features/profile_photos.feature

diff --git a/features/profile_photos.feature b/features/profile_photos.feature
new file mode 100644
index 0000000000..435cb704e2
--- /dev/null
+++ b/features/profile_photos.feature
@@ -0,0 +1,27 @@
+@javascript
+Feature: show photos
+
+  Background:
+    Given following users exist:
+      | username      | email               |
+      | Bob Jones     | bob@bob.bob         |
+      | Alice Smith   | alice@alice.alice   |
+      | Robert Grimm  | robert@grimm.grimm  |
+    And I sign in as "robert@grimm.grimm"
+
+    Given I expand the publisher
+    And I have turned off jQuery effects
+    And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
+    And I press "Share"
+    
+    Scenario: see my own photos
+      And I am on "robert@grimm.grimm"'s page   
+      When I follow "View all" 
+      Then I should be on person_photos page
+    
+    Scenario: I cannot see photos of people who don't share with me
+      When I sign in as "alice@alice.alice"
+      And I am on "robert@grimm.grimm"'s page
+      Then I should not see "photos" within "div#profile"
+
+
diff --git a/features/support/paths.rb b/features/support/paths.rb
index b3553e1410..fd18b67bec 100644
--- a/features/support/paths.rb
+++ b/features/support/paths.rb
@@ -1,6 +1,8 @@
 module NavigationHelpers
   def path_to(page_name)
     case page_name
+      when /^person_photos page$/
+         person_photos_path(@me.person)
       when /^the home(?: )?page$/
         stream_path
       when /^step (\d)$/
-- 
GitLab