mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Ok, so here is the plan. Let's give both our cucumber features and your cypress tests a prominent place to live. That would be the root level folder of our application. Second, let's revive formerly dead code step by step. Ie. move code from the former location `backend/features/` to `features/` when it is ready. All edge cases should be tested with unit tests in `backend/`, see my `webfinger.spec.js` as an example.
37 lines
1.2 KiB
Gherkin
37 lines
1.2 KiB
Gherkin
Feature: Webfinger discovery
|
|
From an external server, e.g. Mastodon
|
|
I want to search for an actor alias
|
|
In order to follow the actor
|
|
|
|
Background:
|
|
Given our CLIENT_URI is "http://localhost:3000"
|
|
And we have the following users in our database:
|
|
| name | slug |
|
|
| Peter Lustiger | peter-lustiger |
|
|
|
|
Scenario: Search a user
|
|
When I send a GET request to "/.well-known/webfinger?resource=acct:peter-lustiger@localhost"
|
|
Then the server responds with a HTTP Status 200 and the following json:
|
|
"""
|
|
{
|
|
"subject": "acct:peter-lustiger@localhost:3000",
|
|
"links": [
|
|
{
|
|
"rel": "self",
|
|
"type": "application/activity+json",
|
|
"href": "http://localhost:3000/activitypub/users/peter-lustiger"
|
|
}
|
|
]
|
|
}
|
|
"""
|
|
And the Content-Type is "application/jrd+json; charset=utf-8"
|
|
|
|
Scenario: Search without result
|
|
When I send a GET request to "/.well-known/webfinger?resource=acct:nonexisting@localhost"
|
|
Then the server responds with a HTTP Status 404 and the following json:
|
|
"""
|
|
{
|
|
"error": "No record found for \"nonexisting@localhost\"."
|
|
}
|
|
"""
|