add own posts to activity-stream again
This commit is contained in:
parent
ab2118ffa5
commit
3b1d113a9a
3 changed files with 19 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue