diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index 0228358c0..3c78a5725 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -114,6 +114,7 @@ app.Router = Backbone.Router.extend({ }, photos : function(guid) { + this._loadRelationshipsPreloads(); this.renderPage(function() { return new app.pages.Profile({ person_id: guid, diff --git a/features/desktop/profile_photos.feature b/features/desktop/profile_photos.feature index 72e45ac36..644b21ecf 100644 --- a/features/desktop/profile_photos.feature +++ b/features/desktop/profile_photos.feature @@ -7,18 +7,11 @@ Feature: show photos | Bob Jones | bob@bob.bob | | Alice Smith | alice@alice.alice | | Robert Grimm | robert@grimm.grimm | + And "robert@grimm.grimm" has posted a status message with a photo 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" - Then I should see a "img" within ".stream_element div.photo_attachments" - Scenario: see my own photos When I am on "robert@grimm.grimm"'s page - #TODO: find out why images don't show on first load - And I am on "robert@grimm.grimm"'s page And I press the first "#photos_link" Then I should be on person_photos page @@ -27,6 +20,15 @@ Feature: show photos And I am on "robert@grimm.grimm"'s page Then I should not see "Photos" within "#profile-horizontal-bar" + Scenario: I can see public photos of people who share with me + When "robert@grimm.grimm" has posted a public status message with a photo + And I sign in as "alice@alice.alice" + And I am on "robert@grimm.grimm"'s page + Then I should see "Photos" within "#profile-horizontal-bar" + When I press the first "#photos_link" + Then I should be on "robert@grimm.grimm"'s photos page + And I should see "Photos" within "#profile-horizontal-bar" + Scenario: I delete a photo When I am on "robert@grimm.grimm"'s photos page Then I should see a ".thumbnail" within "#main_stream" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 9074fccb1..45e1ded4c 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -158,9 +158,14 @@ Then /^I should not see "([^\"]*)" in the last sent email$/ do |text| email_text.should_not match(text) end -When /^"([^\"]+)" has posted a status message with a photo$/ do |email| +When /^"([^\"]+)" has posted a (public )?status message with a photo$/ do |email, public_status| user = User.find_for_database_authentication(:username => email) - post = FactoryGirl.create(:status_message_with_photo, :text => "Look at this dog", :author => user.person) + post = FactoryGirl.create( + :status_message_with_photo, + text: "Look at this dog", + author: user.person, + public: public_status.present? + ) [post, post.photos.first].each do |p| user.add_to_streams(p, user.aspects) user.dispatch_post(p)