User Stories - TranquilTort/Ask-Meeple GitHub Wiki
Viewing site (as unauthorized user)
When I'm on the / page:
I would like to be able to view posts.
I would like to be able to view comments.
I would like to be able to search posts, by title or tag. (Bonus: search by comments.)
I would like to have a 'Login/Create Account' button on the navigation bar.
If I want to interact with the website in a way that requires login, I will be redirected to a /sign-in page.
I would like to see a sidebar that persists on each page, and that displays a list of tags.
I would like these tags to be clickable, so as to perform search functionality (as listed below).
Logging in
When I'm not logged in, I should see that the Login page is available at top of the navigation.
When I try to perform an action that requires authentication, I should be redirected to the /sign-in.
On the Login page, I should see a form that allows me to enter my email and password.
Upon successful authentication, I should automatically be logged in and redirected to the /.
If I don't have an account already, I should be given the option to create an account via a button that links to the /users/register.
Signing up
As an unregistered user, I want to be provided with a form to easily enter my desired username, email and password.
Any errors in my password authentication, or if my username is not unique, will be presented to me clearly in order for me to fix those errors.
Upon successful completion of the Signup form, I will automatically be logged in and redirected to the /.
Now I should have access to actions that require authentication.
Creating post
When I'm not logged in, I should not be able to create a post.
If I try to do so, I should be redirected to the /sign-in.
If I'm logged in and I want to create a post, I want to be presented with an easily viewable button that redirects me to a /new-post.
On /new-post, I want to be able to define my post title, tags, fill-in body, and have the option to add an image via URL.
If my post does not have a title or body, and I try to submit my post, I should receive an error(s) reminding me that those fields are required for a post submission.
If I have any errors in my form, I should see the list of my errors displayed above my form.
Once my post is completed correctly, I can click a submission button and be redirected to /posts/:id displaying my newly created post (I should also see comments here in the future).
I can leave this page by clicking in the navigation.
Editing post
When I'm not logged in, I should not be able to edit a post.
If I try to do so, I should be redirected to the /sign-in.
When I'm on /, and I want to edit my post, I should be able to click a button to edit my post.
After clicking to edit my post, I should be redirected to the /posts/:id/edit, where I should see a post edit form with my previous content already uploaded.
After I successfully edit my post, I should be redirected to /posts/:id.
When I edit a post, nothing should happen to the comments attributed to it.
Deleting post
When I'm not logged in, I should not be able to delete a post.
If I try to do so, I should be redirected to the /sign-in.
When I'm on /, and I want to delete my post, I should be able to click on a post I own and be taken to /posts/:id/edit. On /posts/:id/edit I should be given the option to delete my post.
If I click to delete my post, I should be asked to verify my action.
If I verify that I want to delete my post, my post should be removed.
When my post is removed, all comments on my post should also be removed.
Tags
When I'm creating a new post, I should see a list of available tags I can attribute to my post.
I should be able to apply as many tags to my post as I would like.
I would like these tags to be displayed on my post when it is displayed anywhere on the site.
When viewing the post on the site, I would like these tags to be clickable, so that if I click on a tag, I am redirected to /search/:search-term with my clicked tag as the search term.
I would like to see a sidebar that persists on each page, and that displays a list of tags.
I would like these tags to also be clickable, so as to perform the same search functionality listed above.
Commenting
When I'm not logged in, I should not be able to create a comment.
If I try to do so, I should be redirected to /sign-in.
I will click on the comments button attached to the post I'm interested in commenting on, and I should be redirected to /posts/:id for that post.
When on /posts/:id, I can view other users' comments, as well as open up a text field to submit my own comment.
If I try to submit a comment with no text, I should receive an error and be asked to try again.
Once I have filled out the comment text field, and clicked the submit comment button, my comment should be displayed at the bottom of the comment page.
Editing comments
When I'm not logged in, I should not be able to edit a comment.
If I try to do so, I should be redirected to the /sign-in.
When I'm on /posts/:id, and I want to edit my comment, I should be able to click a button to edit my comment.
After clicking to edit my comment, I should see a form with my previous comment content already uploaded. I should be able to edit my comment here.
After I successfully edit my comment, my comment should automatically be updated without having to reload /posts/:id.
Deleting comments
When I'm not logged in, I should not be able to delete a comment.
If I try to do so, I should be redirected to the /sign-in.
When I'm on /posts/:id, and I want to delete my comment, I should be able to click a delete button and asked for verification.
If I verify that I want to delete my comment, my comment should be removed.
Searching
I want searching to be available at all times/from any page via the navigation bar.
I would like the search form to be a simple text field and submit button.
When I type my input into the field and click the search button, I would like to be redirected to /search/:search-term displaying all my search results.
I would like search results to be displaying in a similar manner to / layout, with the same features (such as edit and delete post).
Search results should contain posts whose body text, title, or tags match my search query.
From the results page, I should be able to click on any post to view it and it's comments.