-
Notifications
You must be signed in to change notification settings - Fork 0
User Stories
As an unauthorized user, I want to be able to create an account, so that I can access my own Jokes on Laughs.
- How will a user login?
- User will login via email or username and password
- Will we confirm their password during signup?
- Yes
- What routes should we use for login?
- POST: log in user
- DELETE: log out user
- GET: restore session user
- Where should the user be redirected after signup?
- Take them to the post a joke page
- Where should the user be redirected after login?
- Personal Joke Newsfeed Page
- Will we allow OAuth authentication via a third party?
- No
- What will be different on the home view for the logged in user vs not logged in?
- The navbar will give the option to sign up or log in if there is no user in session
- What happens if the user doesn't exist/enters bad credentials?
- Display the message "Invalid credentials. Please try again."
- Should this story include allowing a user to reset their password?
- Not yet -- maybe in a future story
Given that I'm a logged-out user and
-
When I'm on the
/
route and click "Log In"- Then there will be a login form with an email or username and password field and a "Log In" button to submit the form.
-
When I try to fill out the form with an invalid email and password combination and the "Login" button
- Then at the bottom of the form, I will see a message "Invalid credentials. Please try again."
-
When I try to fill out the form with a valid email and password and press the "Log In" button
- Then I will stay on the home page, the modal login form will disappear, and the nav bar will update.
-
When I try to click browse jokes
- Then I will be rerouted to a search page with a list view of jokes without the ability to like/comment/or follow users
Given that I am a logged-in user
-
When I refresh a page
- Then I will still be logged in and stay on that page
-
When I try to click browse jokes
- Then I will be rerouted to a search page with a list view of jokes and all their details, plus profile access
As an unauthorized user, I want to be able to sign up for the website via a signup form, so that I can access Laughs.
- Will the user enter a username and an email address to signup?
- User will enter a username and email address to signup.
- Will we confirm their password during signup?
- User will confirm the password through a confirm password field.
- What route should we use for signup?
- The form will use a method of
POST
with an action of/api/user
- The form will use a method of
- Where should the user be redirected after signup?
- Profile Page
- What happens if the user with the username or email already exists?
- Display error
- What happens if the user enters the wrong password confirmation?
- Display error
- How will we protect from cross-site request forgery?
- We will use the
csurf
package
- We will use the
- Will any extra information be requested?
- We will give an option to upload a profile picture
Given that I'm a logged-out user and
-
When I'm on the
/
route and click "Sign Up"- Then there will be a sign-up form with an email or username and password field and a "Sign-Up" button
-
When I try to fill out the form with any invalid or non-unique information
- Then at the bottom of the form, I will see corresponding errors.
-
When I try to fill out the form with a valid username, email and password and press the "Sign-Up" button
- Then I will be redirected to my profile page, the modal login form will disappear, and the nav bar will update.
As a logged-in or logged-out user, I want to see a Nav Bar at the top of the page, so I can navigate between pages and logout.
- What will the nav bar allow the user to do?
- Navigate between pages and logout
- What links will there be in the nav bar?
- Logged in:
- Browse Jokes, My Jokes, profile dropdown
- Logged out:
- Browse Jokes, Log In, Sign Up
- Logged in:
- What will be displayed on the user profile dropdown?
- Username, email, messages, logout
- How will the nav bar allow a user to logout?
- There will be an option to logout on the profile dropdown
- When a user clicks the logout button, what page will they be redirected to?
- Splash Page
Given that I am a logged-in user
-
When I click logout
- Then the navbar will be updated, and I will be redirected to the Splash Page
-
When I click on "Browse Jokes"
-
Then I will be redirected via the href on the anchor tag to
/jokes
.
-
Then I will be redirected via the href on the anchor tag to
-
When I click on "My Jokes"
-
Then I will be redirected via the href on the anchor tag to
/users/:UserId(\\d+)
-
Then I will be redirected via the href on the anchor tag to
-
When I click on "Messages" in the profile dropdown
-
Then I will be redirected via the href on the anchor tag to
/messages
where the id is the current user - I will see a list of the people I have messaged
-
Then I will be redirected via the href on the anchor tag to
-
When I click on a users name in the list of people messaged
-
Then I will be directed to
/messages/:UserId(\\d+)
where userId is the other user I am messaging.
-
Then I will be directed to
As a logged in user I want to see a list of all the jokes on site
- How many jokes will the user be able to see on the screen at a time?
- All jokes will be listed by order of creation with the newest at the top
- How will users narrow down the search criteria?
- Filter jokes by type
- What information will users be able to see on jokes in the list?
- Basic information including
username
andtype
- The
name
of the joke will have an anchor with an href to the detailed view of that joke (/jokes/:id(\\d+)
).
- Basic information including
- What route is used to view jokes?
- A
GET
request to/api/jokes
- A
Given that I am a logged-in user
-
When I use the option to view jokes
- Then a list of all jokes shows up ordered by creation date until you add a filter for best match.
-
When I click on a specific joke
-
Then I will be redirect to
/jokes/:id(\\d+)
-
Then I will be redirect to
Given that I am a non logged-in user
-
When I use the option to view jokes
- Then a list of all jokes shows up ordered by creation date
-
When I click on a specific joke
- Then I will be prompted to create an account to view that jokes profile.
As a registered user, I want to add a new pet, so that I and others can view and match with them.
- What route will be used to get to the "Create a Joke Profile" form?
- User will be directed to a "Create a Joke Profile" form via the
/jokes/new
route - The form will use a method of
POST
with an action of/api/jokes
- User will be directed to a "Create a Joke Profile" form via the
- What fields will be shown on the form?
- Everything from Joke Table
-
userId
will be set on the backend to id of user who is logged in and creating the pet profile
- What happens when a user enters invalid credentials?
- Display errors
- Where will we redirect a user after creating a joke profile?
- To that detailed view page of the newly created joke profile (
/jokes/:jokeId(\\d+)
)
- To that detailed view page of the newly created joke profile (
- What happens if a joke already exists with the same name?
- jokes can have the same name
- How will we protect from cross-site request forgery?
- We will use the
csurf
package
- We will use the
Given that I am a logged-in user
-
When I fill in the joke profile form with valid information
- Then the new joke appears listed
-
- When I add invalid or missing information to the form and attempt to submit
- Then the form validations fail and return me to the form with an error message.
As a logged-in-user I want to be able to message another user, so that I can interact with other users.
- Who can a user message?
- Any other user by clicking on the "send message" button on the users profile
- How would the user see messages they have already sent/received
- Via the profile dropdown menu
Given I am a user that’s signed in.
-
When I message another user.
- Then that message will appear in the other users messages.
As an authorized user, I want to be able to log out of my account, so that I can hide my account information to the rest of the users on this device.
- What happens when the user logs out?
- User will be redirected to the
/login
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 to log out
- 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 log out of my account
-
Given that I'm a logged-in user and
-
When I click the
Log out
button -
Then the server will redirect to the
/login
route
-
When I click the
As a prospective user who just wants to demo Laughs, I want to be able to try out the site with a demo user login via a single click on the login and signup form, so that I can access Laughs 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 username 'demo' and password 'password'
- What routes should we use for login?
- User will login via
/login
route
- User will login via
- Where should the user be redirected after login?
- User will be redirected to
/users/:id
- User will be redirected to
-
Given that I am a logged-out user
-
When I'm on the
/login
or/register
routes - 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 a logged-in-user I want to be able to Follow a user, so that I can keep a record of my Followers
- How would the page let the user know a usr has a “Follower”?
- Detail view can contain a list of followers
- How would the app update the database with the new follower?
- We will use flask to create a new entry in our Followers table
Given I am a user that’s signed in.
-
When I click Follow
- Then a drop down option will appear for which I can view my following.