Fix other user's profile photos stream
This commit is contained in:
parent
dc236b8b9d
commit
020f8c51b4
3 changed files with 18 additions and 10 deletions
|
|
@ -114,6 +114,7 @@ app.Router = Backbone.Router.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
photos : function(guid) {
|
photos : function(guid) {
|
||||||
|
this._loadRelationshipsPreloads();
|
||||||
this.renderPage(function() {
|
this.renderPage(function() {
|
||||||
return new app.pages.Profile({
|
return new app.pages.Profile({
|
||||||
person_id: guid,
|
person_id: guid,
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,11 @@ Feature: show photos
|
||||||
| Bob Jones | bob@bob.bob |
|
| Bob Jones | bob@bob.bob |
|
||||||
| Alice Smith | alice@alice.alice |
|
| Alice Smith | alice@alice.alice |
|
||||||
| Robert Grimm | robert@grimm.grimm |
|
| 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"
|
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
|
Scenario: see my own photos
|
||||||
When I am on "robert@grimm.grimm"'s page
|
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"
|
And I press the first "#photos_link"
|
||||||
Then I should be on person_photos page
|
Then I should be on person_photos page
|
||||||
|
|
||||||
|
|
@ -27,6 +20,15 @@ Feature: show photos
|
||||||
And I am on "robert@grimm.grimm"'s page
|
And I am on "robert@grimm.grimm"'s page
|
||||||
Then I should not see "Photos" within "#profile-horizontal-bar"
|
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
|
Scenario: I delete a photo
|
||||||
When I am on "robert@grimm.grimm"'s photos page
|
When I am on "robert@grimm.grimm"'s photos page
|
||||||
Then I should see a ".thumbnail" within "#main_stream"
|
Then I should see a ".thumbnail" within "#main_stream"
|
||||||
|
|
|
||||||
|
|
@ -158,9 +158,14 @@ Then /^I should not see "([^\"]*)" in the last sent email$/ do |text|
|
||||||
email_text.should_not match(text)
|
email_text.should_not match(text)
|
||||||
end
|
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)
|
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|
|
[post, post.photos.first].each do |p|
|
||||||
user.add_to_streams(p, user.aspects)
|
user.add_to_streams(p, user.aspects)
|
||||||
user.dispatch_post(p)
|
user.dispatch_post(p)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue