mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
PersistentLinks.feature
This commit is contained in:
parent
ddcbeb5b6a
commit
828dc361eb
@ -2,7 +2,6 @@ Feature: Persistent Links
|
|||||||
As a user
|
As a user
|
||||||
I want all links to carry permanent information that identifies the linked resource
|
I want all links to carry permanent information that identifies the linked resource
|
||||||
In order to have persistent links even if a part of the URL might change
|
In order to have persistent links even if a part of the URL might change
|
||||||
|
|
||||||
| | Modifiable | Referenceable | Unique | Purpose |
|
| | Modifiable | Referenceable | Unique | Purpose |
|
||||||
| -- | -- | -- | -- | -- |
|
| -- | -- | -- | -- | -- |
|
||||||
| ID | no | yes | yes | Identity, Traceability, Links |
|
| ID | no | yes | yes | Identity, Traceability, Links |
|
||||||
@ -11,31 +10,23 @@ Feature: Persistent Links
|
|||||||
|
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given we have the following user accounts:
|
Given I have an user account
|
||||||
|
And I am logged in
|
||||||
|
And the following "users" are in the database:
|
||||||
| id | name | slug |
|
| id | name | slug |
|
||||||
| MHNqce98y1 | Stephen Hawking | thehawk |
|
| MHNqce98y1 | Stephen Hawking | thehawk |
|
||||||
And we have the following posts in our database:
|
And the following "posts" are in the database:
|
||||||
| id | title | slug |
|
| id | title | slug |
|
||||||
| bWBjpkTKZp | 101 Essays that will change the way you think | 101-essays |
|
| 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
|
Scenario Outline: Link with healable information is valid and gets auto-completed
|
||||||
When I visit "<url>"
|
When I navigate to page "<url>"
|
||||||
Then I get redirected to "<redirectUrl>"
|
Then I am on page "<redirectUrl>"
|
||||||
Examples:
|
Examples:
|
||||||
| url | redirectUrl |
|
| url | redirectUrl | reason |
|
||||||
| /profile/thehawk | /profile/MHNqce98y1/thehawk |
|
| /profile/thehawk | /profile/MHNqce98y1/thehawk | Identifiable user slug |
|
||||||
| /post/101-essays | /post/bWBjpkTKZp/101-essays |
|
| /post/101-essays | /post/bWBjpkTKZp/101-essays | Identifiable post slug |
|
||||||
|
| /profile/MHNqce98y1 | /profile/MHNqce98y1/thehawk | Identifiable user ID |
|
||||||
Scenario: Link with id only will always point to the same user
|
| /post/bWBjpkTKZp | /post/bWBjpkTKZp/101-essays | Identifiable post ID |
|
||||||
When I visit "/profile/MHNqce98y1"
|
| /profile/MHNqce98y1/stephen-hawking | /profile/MHNqce98y1/thehawk | Identifiable user ID takes precedence over slug |
|
||||||
Then I get redirected to "/profile/MHNqce98y1/thehawk"
|
| /post/bWBjpkTKZp/the-way-you-think | /post/bWBjpkTKZp/101-essays | Identifiable post ID takes precedence over slug |
|
||||||
|
|
||||||
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 |
|
|
||||||
@ -84,15 +84,6 @@ Given("we have a selection of tags and categories as well as posts", () => {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
Given("we have the following user accounts:", table => {
|
|
||||||
table.hashes().forEach(params => {
|
|
||||||
cy.factory().build("user", {
|
|
||||||
...params,
|
|
||||||
...termsAndConditionsAgreedVersion
|
|
||||||
}, params);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Given("my user account has the role {string}", role => {
|
Given("my user account has the role {string}", role => {
|
||||||
cy.factory().build("user", {
|
cy.factory().build("user", {
|
||||||
role,
|
role,
|
||||||
|
|||||||
@ -9,19 +9,24 @@ Given("the following {string} are in the database:", (table,data) => {
|
|||||||
deleted: Boolean(attributesOrOptions.deleted),
|
deleted: Boolean(attributesOrOptions.deleted),
|
||||||
disabled: Boolean(attributesOrOptions.disabled),
|
disabled: Boolean(attributesOrOptions.disabled),
|
||||||
pinned: Boolean(attributesOrOptions.pinned),
|
pinned: Boolean(attributesOrOptions.pinned),
|
||||||
}, {
|
},
|
||||||
...attributesOrOptions,
|
attributesOrOptions,
|
||||||
});
|
);
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
case "comments":
|
case "comments":
|
||||||
data.hashes().forEach((attributesOrOptions, i) => {
|
data.hashes().forEach((attributesOrOptions, i) => {
|
||||||
cy.factory().build("comment", {
|
cy.factory().build("comment",
|
||||||
...attributesOrOptions,
|
attributesOrOptions,
|
||||||
}, {
|
attributesOrOptions,
|
||||||
...attributesOrOptions,
|
);
|
||||||
});
|
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
case "users":
|
||||||
|
data.hashes().forEach(params => {
|
||||||
|
cy.factory().build("user",
|
||||||
|
params,
|
||||||
|
params);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user