Skip to content
Extraits de code Groupes Projets
Valider 3b1d113a rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

add own posts to activity-stream again

parent ab2118ff
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -5,17 +5,28 @@ Feature: Viewing my activity on the steam mobile page
I want to view my activity stream
Background:
Given a user with username "alice"
Given following users exist:
| username |
| alice |
| bob |
And a user with username "bob" is connected with "alice"
And "alice@alice.alice" has a public post with text "Hello! I am #newhere"
And I sign in as "alice@alice.alice" on the mobile website
Scenario: Show my activity empty
When I sign in as "bob@bob.bob" on the mobile website
When I go to the activity stream page
Then I should see "My activity" within "#main"
And I should not see "Hello! I am #newhere"
Scenario: Show post on my activity
Scenario: Show liked post on my activity
When I sign in as "bob@bob.bob" on the mobile website
When I click on selector "a.like-action.inactive"
And I go to the activity stream page
Then I should see "My activity" within "#main"
And I should see "Hello! I am #newhere" within ".ltr"
Scenario: Show own post on my activity
When I sign in as "alice@alice.alice" on the mobile website
And I go to the activity stream page
Then I should see "My activity" within "#main"
And I should see "Hello! I am #newhere" within ".ltr"
......@@ -19,7 +19,11 @@ module EvilQuery
end
def posts
Post.joins(:participations).where(:participations => {:author_id => @user.person.id}).order("posts.interacted_at DESC")
author_id = @user.person_id
Post.joins("LEFT OUTER JOIN participations ON participations.target_id = posts.id AND " \
"participations.target_type = 'Post'")
.where(::Participation.arel_table[:author_id].eq(author_id).or(Post.arel_table[:author_id].eq(author_id)))
.order("posts.interacted_at DESC")
end
end
......
......@@ -36,8 +36,6 @@ end
describe EvilQuery::Participation do
before do
@status_message = FactoryGirl.create(:status_message, :author => bob.person)
# done in StatusMessagesController#create
bob.participate!(@status_message)
end
it "includes posts liked by the user" do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter