-
Notifications
You must be signed in to change notification settings - Fork 1
User Stories
Lazytangent edited this page Jan 23, 2021
·
7 revisions
As an unauthorized user, I want to be able to create an account, so that I can use the application's services.
- Will the user enter a username and an email to signup?
- Both a username and email will be required
- Will we confirm their password during signup?
- Yes
- What routes should we use for signup?
- None, the signup form will be a modal that pops up when called upon
- Where should the user be redirected after signup?
- The user will be redirected to the main Drinks page, where they can browse the selection of drinks available.
- Will we allow OAuth authentication via a third party?
- Not yet
- What happens if the user with the username or email already exists?
- The form will render the error upon submission.
- What happens if the user enters the wrong password confirmation?
- The form will render the error upon submission.
-
Given that I'm a user who has not signed up yet and
-
When I click on the
Register
button in the NavBar - Then there will be a form that pops up with an email, username, and password field with a "Register" button to submit the form.
-
When I click on the
-
Given that I'm a user trying to make an account,
- 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 "Register" button
-
Then at the top of the form, I will see a message
User with that username already exists
orUser with that email already exists
.
-
Given that I'm a user trying to make an account,
- When I try to fill out the form with a password shorter than 6 characters and press Enter or press the "Register" button,
-
Then at the top of the form, I will see a message
Password must be at least 6 characters long.
-
Given that I'm a user trying to make an account,
- When I try to fill out the form with a valid email, username, and password and press Enter or press the "Register" button,
-
Then I will be redirected to the main Drinks page at
/drinks
-
Given that I'm a user that just signed up
-
When I refresh the homepage at the
/drinks
route - Then I will still be logged in
-
When I refresh the homepage at the
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.
- Will the user use a username or email address to log in?
- User can use either their username or email address to log in.
- What routes should we use for log in?
- User will log in via the log in modal that will pop up when called upon.
- Where should the user be redirected after login?
- User will be redirected to
/drinks
page
- User will be redirected to
- Will we allow OAuth authentication via a third party?
- Not yet
- What happens if the user doesn't exist yet or the user enters a field with the wrong credentials?
- Display the message Invalid Login with the given credentials.
- Will the user be able to reset their password?
- Not yet
- Should logging in use session-based or token-based authentication?
- We will use token-based authentication.
-
Given that I'm a logged-out user and
- When I click on the Login button in the NavBar
- Then there will be a login form with a "Username or Email" field, a password field, and a "Login" button to submit the form.
-
Given that I'm a logged-out user and
- When I try to fill out the form with an invalid email/username and password combination and press Enter or press the "Login" button
-
Then at the top of the form, I will see a message
Invalid Login. Please try again.
-
Given that I'm a logged-out user and
- When I try to fill out the form with a valid username/email and password combination and press Enter or press the "Login" button
-
Then I will be redirected to the
/drinks
page
-
Given that I'm a logged in user
-
When I refresh the homepage at the
/drinks
route - Then I will still be logged in
-
When I refresh the homepage at the
-
Given that I am a logged-out user
-
When I try to navigate to the homepage at the
/drinks
route -
Then I will be redirected to the
/
main page
-
When I try to navigate to the homepage at the
As an authorized user, I want to be able to log out of my account, so that I can hide my account information from the rest of the users on this device.
- What happens when the user logs out?
- User will be redirected to the
/
page with a message at the top telling them the log out was successful.
- User will be redirected to the
- How will the user log out?
- User will click the
Log out
button in the User menu that is accessible from the NavBar on any page of the site.
- User will click the
-
Given that I'm a logged-in user and
- When I'm on any route
- Then I should be able to access the user menu in the NavBar and log out of my account
-
Given that I'm a logged-in user and
-
When I click the
Log out
button -
Then I will be redirected back to the
/
page.
-
When I click the
As a prospective user who just wants to demo the functionality of The Juice Box, I want to be able to try out the site with a demo user login via a single click on the login and register forms, so that I can access The Juice Box without having to go through the trouble of creating a new account.
- Will the user enter a username or an email address to login?
- User will login via the "Demo User Login" button.
- What routes should should we use for login?
- User will log in via the log in modal that will pop up when called upon.
- Where should the user be redirected after login?
- User will be redirected to
/drinks
.
- User will be redirected to
-
Given that I am a logged-out user
-
When I'm on the
Login
orRegister
forms - Then there will be a button that will let me login as a demo user
-
When I'm on the
-
Given that I am logged in as the demo user
- When I refresh any page
- Then I should still be logged in as the demo user
As a logged in user, I want to be able to see all of the possible drinks, so I can choose one to make or drink.
- What route will show all the drinks?
/drinks
- What route will show an individual drink?
/drinks/:drinkId
-
Given that I am a logged in user
-
When I'm on the
/drinks
page - Then I will see all the drinks on the site
-
When I'm on the
-
Given that I am a logged in user
-
When I'm on a
/drinks/:drinkId
page - Then I will see the details for the drink with the corresponding id
-
When I'm on a
As a logged in user, I want to be able to create a new drink, so that I can share my drinks with everyone else.
- What route will show the form to create a new drink?
/drinks/new
-
Given that I am a logged in user
-
When I navigate to
/drinks/new
- Then I will see a form with name and description fields.
-
When I navigate to
-
Given that I am a logged in user
-
When I submit the form on
/drinks/new
- Then I will be redirected to the new drinks page
-
When I submit the form on
As a logged in user, I want to be able to delete one of my drinks, so that I can clean up my creations.
- How will a user delete one of their drinks?
- There will be a "Delete" button on the drink detail page if the user is the same user that created the drink.
- Where will the app redirect to when a drink is delete successfully?
- The app will redirect to the
/drinks
page with a message at the top notifying the user that their drink was deleted successfully.
- The app will redirect to the
-
Given that I am a logged in user and the creator of a drink
- When I navigate to the drink's details page
- Then I will see the option to delete it
-
Given that I am a logged in user and the creator of a drink
- When I click on the delete button on the drink's detail page
-
Then I will get redirected to the
/drinks
page and shown a message notifying me that my drink was successfully deleted
-
Given that I am a logged in user and not the creator of a drink
- When I navigate to the drink's detail page
- Then I will not get the option to delete the drink
- How will a user edit one of their drinks?
- There will be an "Edit" button on the drink detail page if the user is the same user that created the drink.
- Where will the app redirect when the "Edit" button is clicked?
- The user will stay on the detail page, and the name and description fields will change into input fields. Essentially rendering the form in-place
- Where will the app redirect when the "Edit" form is submitted?
- The user will be redirected back to an updated detail page
- Given that I am a logged in user and the creator of a drink