user story and acceptance criteria - RobertVogue/Passport GitHub Wiki

User Story and Acceptance Criteria

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 / homepage or the /users 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?
    • Users will not have access to select features but will still be able to view the site.
  • What happens if the user enters the wrong password?
    • Display the message Invalid Login.
  • Should this story include allowing a user to reset their password?
    • Not yet -- maybe in a future story
  • Should logging in use session-based or use token-based authentication?
    • We will use session based auth for now

Acceptance Criteria

  • 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 Enter or press the "Login" button
    • Then I will be directed to my profile page

Logout

As an authorized user, I want to be able to log out of the website by clicking a button in order to end my current session.

Questions

  • Where will the user who logs out be redirected?
    • A logged out user will be redirected to / homepage.
  • When will the user be able to access website features?
    • As soon as the user either logs in or registers.
  • How will the user know they are logged out after clicking the logout button?
    • The homepage will display a login button and contribution features will be disabled.

Acceptance Criteria

  • Given that I'm a logged-out user and
    • When I'm on the / route
    • Then there will be a login form with an email and password field and a "Login" button to submit the form.

Signup

As an unauthorized user, I want to be able to sign up for the website via a signup form, so that I can access the website.

Questions

  • What features are accessible to a user who is not logged in?
    • The user will have access to view the site but will be blocked from posting, voting, or using profile features.
  • Will the user enter a username and an email address to signup?
    • Yes, the user will enter both.
  • Will we confirm their password during sign up?
    • Yes, their passwords will need to match
  • What routes should we use for signup?
    • The route / will act as the sign up page
  • Where should the user be redirected after signup?
    • The user will be redirected to / the homepage
  • Will we allow OAuth authentication via a third party?
    • No, authentication will be made via the site and not using a third party.
  • What happens if the user with the username or email already exists?
    • Due to the unique constraint, the user will be given a message explaining the username or email is already in use
  • What happens if the user enters the wrong password confirmation?
    • The user will be prompted a message explaining the passwords do not match

Acceptance Criteria

  • Given that I'm a user who has not yet signed up 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 message “User with that email or username already exists”.
  • 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 User

As a first-time user who just wants to demo Passports, I want to be able to try out the site with a demo user login via a single button click on the login and signup form, so that I can access Passports without having to go through the trouble of creating a new account.

Questions

  • What will the home page of the Demo User include?
    • The home page for the Demo User will include a sign up form in the top of the body.
    • It will also display a generic layout
  • What will a generic layout render as far as content?
    • This will include a stack of images of possible Stamps to add.

Acceptance Criteria

  • Given that I am a Demo user who has yet to sign up and
    • When I’m on the /demo Home route
    • Then there will be a home page similar to that of a logged in user.
  • When the Demo user tries to create a stamp
    • Then stamps will be added to database

Navigation Bar

As a user regardless of registered status, I want to be able to access the Nav Bar so I can route to different pages on the website.

Questions

  • Will the registered user navbar be consistent across all pages?
    • Yes, all pages will have the same navbar for registered users with a sign out button
  • Will the unregistered user navbar be consistent across all pages?
    • Yes, all pages will have the same navbar for unregistered users without the sign out button
  • What will be displayed on nav bar for registered users?
    • A button to take the user to the home page (logo)
    • A button to take a registered user to their profile page
    • A button to take a registered user to create a stamp form
    • A button to logout a registered user

Acceptance Criteria

  • Given that I am a registered user and
    • When I am on any page,
    • Then I can access the same navbar features as when I am on the / route homepage
  • Given that I am an unregistered user and
    • When I am on any page,
    • Then I can access the same unregistered user navbar features as when I am on the / route homepage

See all Stamps on the Profile page

As a logged-in user I want to see my Stamps and other’s Stamps so I can make reviews of the places I’ve been.

Questions

  • Will the Stamps be listed on the profile page?
    • Yes, Stamps will be displayed on the profile page in list order.
  • What does the Stamp display?
    • The Stamp displays the location logo, name, and date.
  • Will the user be able to view more than one Stamp at a time?
    • Yes, all Stamps on passports will be shown at the same time.
  • Where should the user be redirected after clicking on a Stamp?
    • The user will be redirected to /users/passports/:StampId.
  • What routes should we use for displaying Stamps?
    • The route /users/passports will display all the user’s Stamps.
  • Will a user be able to click on a Stamp if they aren’t registered?
    • Yes, Stamps will be viewable when unregistered.

Acceptance Criteria

  • Given that I’m a logged-in user and
    • When I’m on the /users/passports route
    • Then there will be a full display of Stamps.
  • When I try to click on a Stamp as an unregistered user
    • Then the route will redirect to the stamp page
  • When I try to scroll through the Stamps
    • Then it will keep populating more Stamps until there is none left

Create a Stamp

As a logged in user I want to be able to create new Stamps so that I can log and share my travel experiences.

Questions

  • How will I navigate to the Create Stamps form?
    • The form will be located in the /create/Stamps/:id(\\d+) page
    • Registered users will be able to click a “Create Stamp” button on the nav bar of any page which will redirect them to /create-Stamps/:id(\\d+) page
    • When unregistered users click on the Create Stamp button, they will be redirected to the home page and alerted to sign in?
  • What fields will be shown in the “Create Stamp” form?
    • Country, dates of vacation, Price, Occupancy, Detailed Location, Description, Rating, and Visited Status
  • What happens if the user enters invalid inputs and clicks the submit button?
    • An error message of “Invalid input” will pop up around each invalid box or
    • All valid inputs will persist despite errors after the submit button is clicked
  • What will happen when the user hits the submit button after entering valid inputs?
    • The user will be redirected to the /Stamp page where they will view the detailed view of the newly created Stamp
    • The user will see an alert message: “Your Stamp was successfully created!”
  • What happens if the user tries to enter a duplicate entry
    • Duplicate entries will be allowed for now

Acceptance Criteria

  • Given I am a registered in user and
    • When I’m on the /create/Stamp page
    • Then I will see a form where I can fill out the create a Stamp form
  • When I click submit after correctly filling out the form
    • Then I will see a message telling me I have successfully created a Stamp

Profile Page

As a logged in user I will be able to view my Stamps, my comments, and Stamps I marked as “want to visit”. I will also have a link to create a new Stamp.

Questions

  • What will happen when an unauthorized user logs in or signs up?
    • They will be redirected to /user/:id the users profile page.
  • Will this page include personal messages or alerts?
    • Not yet, but maybe in future story
  • What route will the profile page use?
    • The profile page will be on the /user/:id route.
  • Where will you be able to navigate to the Profile Page from?
    • A logged in user will be able to navigate to the Profile Page after submitting a log in/sign up form.
    • A logged in user will have a link to their profile in the navigation bar to view their Stamps, personal messages, rating, and status.

Acceptance Criteria

  • Given the user is logged in
    • When the user submits their form
    • Then the user will be redirected to the /users/:id profile page route.
  • Given the user is unauthorized
    • When the user navigates to the website
    • Then the user will not see a ‘view my profile’ link
  • Given the user is logged in
    • When the user navigates to their profile page
    • Then they are able to see their passport

Home Page

As a user visiting the site, I want to have a generic layout with the ability to navigate the site.

Questions

  • What will happen when you visit the home page as a logged in user?
    • As a logged in user I want to be able to see Stamps that are suggested from the site.
  • Will the home page be viewable by an unauthorized user?
    • Yes, an unauthorized user will be able to navigate to the home page without being prompted to sign up.
  • Will an unauthorized user be able to click on a Stamp?
    • An unauthorized user will have a floated sign up form with homepage set to blur.
  • What will happen when a logged in user clicks on a Stamp?
    • User will be redirected to /Stamp/:id

Acceptance Criteria

  • When visiting the home page as a logged in user
    • Then I will not be prompted to log in after clicking any link.
  • When visiting the home page as an unauthorized user
    • Then the home page will appear the same, except most links will prompt the user to sign up or log in.
  • Given the user is an unauthorized user
    • When trying to access a Stamps detail page
    • Then the user will be prompted to log in or sign up

Stamp Status

As a logged-in user I want to be able to select a dropdown so that I can mark a Stamp as "visited", "want to visit", or “Near By."

Questions

  • Where will the dropdown be available for a user?
    • On the creation page and on the detailed view of Stamp /Stamps/:id(\\d+
  • How would our app handle updating the database?
    • Changing the value to “visited”, “want to visited”, “near by”
    • Will have a status table joined to the Stamp table
  • Will users be able to change the visited Stamps from the home page?
    • No, marking Stamps will only be available in the detailed and Stamp creation view of a specific Stamp at first
  • Will users be able to change their Stamp’s status on the passport page?
    • No, you can only change it by clicking on their Stamp to get to the detailed view of the Stamp where the drop down will be available.

Acceptance Criteria

  • Given I am a logged-in user
    • When I select the “visited” dropdown
    • Then the Passport App will use AJAX to update the Stamp status button by changing the color and the Stamp status to “visited”
  • When I select the “will visit” dropdown
    • Then the Passport App will use AJAX to update the Stamp status by changing the color and the text to “want to visit”
  • When I select the “local” dropdown
    • Then the Passport App will use AJAX to update the Stamp status by changing the color and the text to “local”
⚠️ **GitHub.com Fallback** ⚠️