mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Sketch 🥒 for #240
This commit is contained in:
parent
58938dc2d8
commit
51ca20335a
@ -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)
|
||||
})
|
||||
|
||||
41
cypress/integration/identifier/PersistentLinks.feature
Normal file
41
cypress/integration/identifier/PersistentLinks.feature
Normal 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 |
|
||||
Loading…
x
Reference in New Issue
Block a user