Fix other user's profile photos stream

This commit is contained in:
Steffen van Bergerem 2016-08-09 00:29:04 +02:00
parent dc236b8b9d
commit 020f8c51b4
No known key found for this signature in database
GPG key ID: 2F08F75F9525C7E0
3 changed files with 18 additions and 10 deletions

View file

@ -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,

View file

@ -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"

View file

@ -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)