Skip to content

Commit

Permalink
Added tests for the like/unlike capabilities
Browse files Browse the repository at this point in the history
This is cleanup from last week, new capability - new tests!
  • Loading branch information
allouis committed Sep 12, 2024
1 parent 342bcd2 commit 46ef68e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions features/like-activity.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Feature: Liking an object
As a user
I want to like an object in my feed
So that I can express my approval of the content

Scenario: Liking an object that has not been liked before
Given an Actor "Alice"
Given a "Create(Note)" Activity "Note" by "Alice"
When "Alice" sends "Note" to the Inbox
And we like the object "Note"
Then the request is accepted
And the object "Note" should be liked
And the object "Note" should be in the liked collection
And a "Like(Note)" activity is sent to "Alice"

Scenario: Liking an object that has been liked before
Given an Actor "Alice"
Given a "Create(Note)" Activity "Note" by "Alice"
When "Alice" sends "Note" to the Inbox
And we like the object "Note"
Then the request is accepted
Then we like the object "Note"
Then the request is rejected with a 409

Scenario: Unliking an object that has not been liked before
Given an Actor "Alice"
Given a "Create(Note)" Activity "Note" by "Alice"
When "Alice" sends "Note" to the Inbox
Then we unlike the object "Note"
Then the request is rejected with a 409

Scenario: Unliking an object that has been liked before
Given an Actor "Alice"
Given a "Create(Note)" Activity "Note" by "Alice"
When "Alice" sends "Note" to the Inbox
And we like the object "Note"
Then the request is accepted
Then we unlike the object "Note"
Then the request is accepted
And the object "Note" should not be liked
And the object "Note" should not be in the liked collection
And a "Undo(Like)" activity is sent to "Alice"

0 comments on commit 46ef68e

Please sign in to comment.