User Stories - makon57/MixTrail GitHub Wiki
Login
- As an unauthorized user, I want to be able to login to the website via a form, so that I can access my private information.
Questions
-
Will the user enter a username or an email address to login?
- User will login via email and password
-
What routes should we use for login?
- User will login via /login route
-
Where should the user be redirected after login?
- User will be redirected to the / homepage
-
Will we allow OAuth authentication via a third party?
- Not yet -- maybe in a future story
-
What happens if the user doesn't exist yet?
- Display the message Invalid Login :( please try again.
-
What happens if the user enters the wrong password?
- Display the message Invalid Login :( please try again.
-
Should this site allow a user to reset their password?
- Not yet -- maybe in the future
-
Should logging in use session-based or use token-based authentication?
- We will use session-based auth for now
Acceptance criteria
-
Given that I'm a logged-out user
- There will be a login form with an email and password field and a "Login" button to submit the form.
-
When I try to fill out the form with an invalid email and password combination and press Enter or press the "Login" button
- Then at the top of the form, I will see a red message Invalid Login :( please try again.
-
When I try to fill out the form with an email that doesn't exist in the system and press Enter or press the "Login" button
- Then at the top of the form, I will see a red message Invalid Login :( please try again.
-
When I try to fill out the form with a valid email and password and press press Enter or press the "Login" button
- Then I will be redirected to the homepage at the /route.
-
Given that I am a logged-in user
- When I refresh the homepage at the / route
- Then I will still be logged in
-
Given that I am a logged-out user
- When I try to navigate to the homepage at the / route
- Then I will be redirected to the /login route
Sign Up
As an unauthorized user, I want to be able to sign up for the website via a signup form, so that I can access this awesome website.
** Questions **
- Will the user enter a username and an email address to signup?
- Yes
- Will we confirm their password during signup?
- Yes
- What routes should we use for signup?
- action="/sign-up"
- Where should the user be redirected after signup?
- redirect "/"
- Will we allow OAuth authentication via a third party?
- Not now, maybe in the future.
- What happens if the user with the username or email already exists?
- Gives error message "User Already Exists"
- What happens if the user enters the wrong password confirmation?
- Gives specific error message "Invalid password validation. Please try again"
** Acceptance Criteria**
-
Given that I'm a user who has not signed up yet and
- When I'm on the / route
- Then there will be a signup form with an email, username, and password field and a "Sign Up" button to submit the form
-
When I try to fill out the form with an email or username that already exists with a valid password and press Enter or press the "Sign Up" button
- Then at the top of the form, I will see a red message User with that email or username already exists.
-
When I try to fill out the form with a password shorter than 6 characters and press Enter or press the "Sign Up" button
- Then at the top of the form, I will see a red message Password must be at least 6 characters long.
-
When I try to fill out the form with a valid email, username, and password and press Enter or press the "Sign Up" button
- Then I will be redirected to the homepage at the / route.
-
Given that I am a user that just signed up
- When I refresh the homepage at the / route
- Then I will still be logged in
Demo login User:
As a demo user, they are able to try out the site with a demo user login via a single button click on the login and signup form, so that they can browse listed trails on MixTrails without having to go through the trouble of creating a new account.
Questions
- What pre-existing data would be available for the demo user?
- Trails/descriptions to view, some trails saved into trailShelves, and some reviews.
View Trails
Questions
-
Does the user need to login to see a list of all listed trails ?
- No, a list of all trails is available to all users
-
How is each trail represented on the page?
- For each trail there's a div with an image of the specific trail.
-
What are actions available on trails images?
- On the click of the icon user would be redirected to /trails/:id(\d+)
-
Is there another way to see the whole list?
- On the navbar on every page, there's a link to / homepage
** Acceptance Criteria**
- When going to / homepage
- Then show the grid of images representing each trail
- When clicking on the image
- Then redirect to /trails/:id(\d+), with specific trail details
View details of each trail
As a user authorized or not I want to see each trail's details.
Questions
- Are trail details available to unauthorized users?
- Yes
- How can I access trail information?
- Clicking on the trail image on the homepage or going to /trails/:id(\d+) page
- What information is available
- Trail name, state location, description, average rating, reviews
Acceptance Criteria
- When provided id in /trails/:id(\d+) is invalid
- Then show 404 error
For logged-out user
- When logged-out user visit's trail's page
- Then show trail name, state, description, average rating, reviews list
- And show the rate panel
- And show the Leave Review button
- When rate panel activated (one of the stars clicked)
- Then redirect to /sign-in page
- When the Leave Review button activated
- Then redirect to /sign-in page
For logged-in users
4.When logged-in user visit's trails page
- Then show trail name, state, description, the average rating
- And show reviews list with user's reviews first and the rest of reviews ordered by date
- And show rate panel
- And show drop-down menu with TrailShelves to add this trail to
- And show the Leave Review form with textarea and submit button
- When the trail was already visited
- Then show the Rate panel with proper class setting
- When the trail wasn't yet visited
- Then to mark trail as visited rate the trail
- And the Review form has mandatory rate field
View all TrailShelves of a user
For logged in users only
Questions
- What route is used?
- /trailShelves
- What would a new user see?
- In the trailShelves there would be a list of the trailShelves and a button to add a new list
- Visited list is empty What would users with many lists see?
- In the trailShelves there would be a default list "Visited", "Want to visit" followed by custom trailShelf and a button to add a new trailShelf
- Visited list as selected.
Acceptance Criteria
As a logged-out user
- When navigating to "/trailShelves"
- Then shows 404 page
As logged-in user
- When a new user's created
- Then trailShelves are listed in the sidebar
- And only two default trailShelves is listed - Visited, Want to visit.
- And the main area has a link "Add Trails" that redirects to / homepage
- When the user has many trailShelves
- Then trailShelves are listed in the sidebar
- And Visited trailShelve is listed on top and is selected
- And custom lists are following in alphabetical order
- And each custom list would have a form with method DELETE and trailShelves "/trailShelves/:id(\d+)"
- When trails marked as visited
- Then trails are listed in the main area
- When no trails marked as Visited
- Then the main area has a link "Add trails" that redirects to / homepage
- When clicking on the trailShelves name
- Then update the main area with trails assigned in the trail
Create trailShelf
For logged-in users only ** Questions**
- Where can the user access the form to add a new trailShelves?
- /trailShelves
- Is form visible?
- No, it's hidden until the Add trailShelves button is not clicked
Acceptance Criteria
- When the Add trailShelves button clicked
- Then show hidden form with field "Shelf name" and "Add Shelf button"
- And there should be hidden field _csrf on that field
- And form has method POST and action /routes
- When the form submitted with an empty field
- Then show error message "Invalid name :( Try again"
- When form submitted with route name longer than 150 characters
- Then show error message "Name is too long :( Try again"
- When route successfully created
- Then add trail name to the list and select it
- And the main area has a link "Add Trails" that redirects to / homepage
View details of each trail
As a user authorized or not I want to see each park's details.
Questions
- Are trail details available to unauthorized users?
- Yes
- How can I access trail information?
- Clicking on the trail image on the homepage or going to /trails/:id(\d+) page
- What information is available
- Trail name, state location, description, average rating, reviews
Acceptance Criteria
- When provided id in /trails:id(\d+) is invalid
- Then show 404 error
For logged-out user
- When logged-out user visit's trail's page
- Then show trail name, location, description, average rating, reviews list
- And show the rate panel
- And show the Leave Review button
- When rate panel activated (one of the stars clicked)
- Then redirect to /sign-in page
- When the Leave Review button activated
- Then redirect to /sign-in page
For logged-in users
- When logged-in user visit's trail's page
- Then show trail name, location, description, the average rating
- And show reviews list with user's reviews first and the rest of reviews ordered by date
- And show rate panel
- And show drop-down menu with routes to add this park to
- And show the Leave Review form with textarea and submit button
- When the trail was already visited
- Then show the Rate panel with proper class setting When the trail wasn't yet visited
- Then to mark trail as visited rate the park
- And the Review form has mandatory rate field
See all the trailShelves for the user
For logged in users only
Questions
- What route is used?
- /trailShelves
- What would a new user see?
- In trailShelves there would be a list Visited and a button to add a new personalized trailShelves
- Visited list a default trailShelves and comes empty
- What would users with many trailShelves see?
- List of all existing trailShelves
Acceptance Criteria As a logged-out user
- When navigating to "/trailShelves" Then shows 404 page
As logged-in user
- When a new user's created
- Then trailShelves are listed in the sidebar
- And only trailShelves listed - Visited , has vistied (default)
- And no trails added
- And the main area has a link "Add Trails" that redirects to / homepage
- When the user has many trailShelves
- Then trailShelves are listed in the sidebar
- And Visited list is displayed on top and is selected
- And custom trailShelves are following in alphabetical order
- And each custom list would have a form with method DELETE and route "/trailShelves/:id(\d+)"
- When trails marked as visited
- Then trails are listed in the main area
- When no trails marked as Visited
- Then the main area has a link "Add Trails" that redirects to / homepage
Create a trailShelves
For logged-in users only
Questions
- Where can the user access the form to add a new shelf?
- /trailShelves
- Is form visible?
- No, it's hidden until the Add trailShelves button is not clicked
Acceptance Criteria
- When the Add trailShelves button clicked
- Then show hidden form with field "trailShelves name" and "Add trailShelves button"
- And there should be hidden field _csrf on that field
- And form has method POST and action /trailShelves
- When the form submitted with an empty field
- Then show error message "Invalid name :( Try again"
- When form submitted with route name longer than 150 characters
- Then show error message "Name is too long :( Try again"
- When trailShelves is successfully created
- Then add trail name to the list and select it
- And the main area has a link "Add trails" that redirects to / homepage
Add trail to trailShelves
For logged in users only
Questions
- How can user add trail to the trailShelves?
- On the trail page "/trails/:id(\d+)" through dropdown menu selection
Acceptance Criteria
- When a logged-out user goes to the trail page
- Then the drop-down menu isn't rendered
- When a logged-in user goes to the trails page
- Then show a drop-down menu with user's trailShelves
- And allow multiple choice for the form
- And do not redirect
Remove trail from the trailList
For logged-in users only
Questions
- How can the user remove the trail from the trailList?
- On the /trailList page select the list and press the remove button next to the trail
- On the /trails/:id(\d+) page through drop-down menu deselect trailList
Acceptance Criteria
- When on /trailList page delete the only trail in the trailList
- Then remove trail from the list and show link "Add trails" that redirects to / homepage in the Main area
- When on /routes page delete one of many trails in the trailList
- Then update the Main area without removed trail
- When on /trails/:id(\d+) page
- Then deselect trailList from the drop-down list
- And do not redirect.
Rate trail/ Add trail to visited
As a logged in user, I want to be able to rate a trail and add it to my visited list, so that I can record where I have been and my experience at the trails out of 5 stars.
Questions
- Will the user need to login before they can rate and add a trail to their visited list?
- Yes, user will need to login.
- Where can the user rate the trail?
- User will be redirected to the rating/review form when they have added a trail to "visited"
- Where can the user add the trail to their visited list?
- User can add the trail they have visited by visiting trail page and clicking "Visited" button on the trail drop down.
Acceptance Criteria
Given that I'm a logged-out user
- When I try to rate trail or add trail to my visited list
- Then I will be prompted to login.
Given that I'm a logged in user
- When I rate a trail on the trail's page
- Then the trail will display the stars you rate it
- When I mark the trail as visited
- Then the trails's page will show in bold that the trail has been visited
- Then the trail will display on the "Visited" list in /trailShelves page
Remove trail from visited
As a logged in user, I want to be able to remove a trail from my visited list so I can make my visited list accurate.
Questions
- Will the user need to login before they can remove a trail from their "Visited" list?
- Yes, user will need to login.
- Where can the user remove the trail from being visited?
- User can access the /trails/:id page and click the visited button to unselect it.
- Or they can access their "Visited" list and click the remove button.
Acceptance Criteria
Given that I'm a logged-out user
- When I try to remove a trail from my visited list
- Then I will be prompted to login.
Given that I'm a logged in user
- When I want to click on the "Visited" button on a trail's page
- Then the button will unselect/unbold.
- When I click "Remove/Delete" the trail from my "Visited" list
- Then the "Visited" list will re-render to have the trail removed.
Add a review on visited trails
As a logged in user, I want to be able to write a review on a trail I visited so that visitors to the site can see my experience at the location.
Questions
- Will the user need to login before they can remove a trail from their "Visited" list?
- Yes, user will need to login.
- Will the user need to visit the trail before writing a review?
- Yes, the user needs to mark the trail as visited before they can write a review.
- Where can the user write a review?
- User can access the /trails/:id page and select the "Write a Review" button.
- Will the user be able to save their draft?
- Not yet
- What happens if the user changes their mind about writing a review?
- They can select the cancel button and be re-directed back to the page.
- Will the user be able to add more than one review?
- No
Acceptance Criteria
Given that I'm a logged-out user
- When I try to write a review for a trail
- Then I will need to login since the button won't be available for logged out users.
Given that I'm a logged in user
- When I want to click on the "Write A Review" button on a trails's page
- Then the user will be redirected to a new page to write a review
- There will be a text box for the user to write the review.
- When I want to submit the review
- Then I can click the "Submit" button
- When I want to cancel the review
- Then I can click the cancel button and be redirected to trail page
Remove review
As a logged in user, I want to be able to remove my review from a park so other viewers can't see my review because I changed my mind about my opinion.
Questions
- Will the user need to login before they can remove a a review?
- Yes, user will need to login.
- Where can the user remove the review?
- User can access the /trails/:id page and click the remove button next to their review.
- What happens if the user didn't mean to delete their review?
- User will need to re-write their review
Acceptance Criteria
Given that I'm a logged-out user
- When I try to remove a review
- Then I will need to login since the button won't be available to logged out users.
Given that I'm a logged in user
- When I want to to remove a review
- Then the remove/delete button will be available next at the review I wrote only.
- When I click "Remove/Delete" on my review
- Then the trails page will re-render to have the review removed.