-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for the like/unlike capabilities
This is cleanup from last week, new capability - new tests!
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |