Sketch 🥒 for #240

This commit is contained in:
Robert Schäfer 2019-03-25 00:09:35 +01:00
parent 58938dc2d8
commit 51ca20335a
2 changed files with 45 additions and 0 deletions

View File

@ -86,6 +86,10 @@ Given('my user account has the role {string}', role => {
When('I log out', cy.logout)
When('I visit {string}', page => {
cy.openPage(page)
})
When('I visit the {string} page', page => {
cy.openPage(page)
})

View File

@ -0,0 +1,41 @@
Feature: Persistent Links
As a user
I want to click on a link with an 'href' having an unmodifiable id of a user
In order to have persistent links even if the user changes a his/her slug
| | Modifiable | Referenceable | Unique | Purpose |
| -- | -- | -- | -- | -- |
| ID | no | yes | yes | Identity, Traceability, Links |
| Slug | yes | yes | yes | @-Mentions, SEO-friendly URL |
| Name | yes | no | no | Search, self-description |
Background:
Given we have the following user accounts:
| id | name | slug |
| MHNqce98y1 | Stepen Hawking | thehawk |
And we have the following posts in our database:
| id | title | slug |
| bWBjpkTKZp | 101 Essays that will change the way you think | 101-essays |
And I have a user account
And I am logged in
Scenario Outline: Link with slug only is valid and gets auto-completed
When I visit "<url>"
Then I get redirected to "<redirectUrl>"
Examples:
| url | redirectUrl |
| /profile/thehawk | /profile/MHNqce98y1/thehawk |
| /post/101-essays | /post/bWBjpkTKZp/101-essays |
Scenario: Link with id only will always point to the same user
When I visit "/profile/MHNqce98y1"
Then I get redirected to "/profile/MHNqce98y1/thehawk"
Scenario Outline: ID takes precedence over slug
When I visit "<url>"
Then I get redirected to "<redirectUrl>"
Examples:
| url | redirectUrl |
| /profile/MHNqce98y1/stephen-hawking | /profile/MHNqce98y1/thehawk |
| /post/bWBjpkTKZp/the-way-you-think | /post/bWBjpkTKZp/101-essays |