Skip to content
Extraits de code Groupes Projets
Valider 6e6a5c1e rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Move multiple participations test to rspec

parent 6ef4345d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -41,35 +41,3 @@ Feature: The activity stream
And I unlike the post "Look at this dog" in the stream
And I go to the activity stream page
Then I should not see "Look at this dog"
Scenario: multiple participations
When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page
Then I should see "Look at this dog"
When I like the post "Look at this dog" in the stream
And I go to the activity stream page
Then I should see "Look at this dog"
When I am on "alice@alice.alice"'s page
Then I should see "Look at this dog"
When I focus the comment field
And I fill in the following:
| text | is that a poodle? |
And I press "Comment"
And I go to the activity stream page
Then I should see "Look at this dog"
When I am on "alice@alice.alice"'s page
And I unlike the post "Look at this dog" in the stream
And I go to the activity stream page
Then I should see "Look at this dog"
When I am on "alice@alice.alice"'s page
And I click to delete the first comment
And I confirm the alert
And I go to the activity stream page
Then I should not see "Look at this dog"
......@@ -65,4 +65,29 @@ describe EvilQuery::Participation do
expect(posts.map(&:id)).to eq([@status_messageE.id, @status_messageA.id, @status_messageB.id])
end
end
describe "multiple participations" do
before do
@status_message = FactoryGirl.create(:status_message, author: bob.person)
@like = alice.like!(@status_message)
@comment = alice.comment!(@status_message, "party")
end
let(:posts) { EvilQuery::Participation.new(alice).posts }
it "includes Posts with multiple participations" do
expect(posts.map(&:id)).to eq([@status_message.id])
end
it "includes Posts with multiple participation after removing one participation" do
@like.destroy
expect(posts.map(&:id)).to eq([@status_message.id])
end
it "doesn't includes Posts after removing all of their participations" do
@like.destroy
@comment.destroy
expect(posts.map(&:id)).not_to include(@status_message.id)
end
end
end
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