User Stories and Acceptance Criteria - StevenBarnett1/Group_Project GitHub Wiki

Log In

  1. Given that I am a logged-out user and
    • When I navigate to /users/login
    • Then there will be a login form with an email and password field and a “Login” button to submit the form
  2. 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”.
  3. 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”.
  4. 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 redirected to /
  5. Given that I am a logged-in user
    • When I refresh the homepage at /
    • Then I will still be logged in
  6. Given that I am a logged-out user
    • When I try to navigate to /
    • Then I will be redirected to /users/login

Registration

  1. Given that I have not created an account and
    • When I navigate to /users/register
    • Then I will see a form with username, email, and password fields, followed by a “Create User” button
  2. When I enter an invalid email, username or password
    • Then at the top of the form, I will see a red message “Account creation failed, invalid (username/email/password) :( please try again”.
  3. When I enter a valid username, password, and email
    • Then a user account will be created, automatically logged in, and redirected to /
  4. Given that I am a logged in user
    • When I navigate to /users/register
    • Then I will be redirected to /

Getting Questions

  1. Given that I am a logged-out user and
    • When I navigate to /
    • Then I will be able to see all of the questions
  2. Given that I am a logged-in user and
    • When I navigate to /
    • Then I will be able to see all of the questions
  3. Given that I am a logged-out user and
    • When I navigate to /questions/:id
    • Then I will be able to see the specific question
  4. Given that I am a logged-in user and
    • When I navigate to /questions/:id
    • Then I will be able to see the specific question

Posting Questions

  1. Given that I am a logged-out user and
    • When I navigate to / and try to create a question
    • Then I will be redirected to /users/login and an error message will be displayed “Please sign-in to ask questions”
  2. Given that I am a logged-in user and
    • When I navigate to / and try to create a question
    • Then I will be prompted to fill in a title and question body
  3. When I try to post a question with no title
    • Then an error message will be displayed “Invalid post, the title is still empty, please enter the title :(“
  4. When I try to post a question with no body
    • Then an error message will be displayed “Invalid post, the body is still empty, please enter the body :(“
  5. When I try to post a question with a title and body
    • Then my question will be created and I will be redirected to /

Deleting Questions

  1. Given that I am a logged-out user and
    • When I navigate to a specific question
    • Then I will be unable to delete the question
  2. Given that I am a logged-in user and
    • When I navigate to one of my questions
    • Then I will be able to delete the question, once deleted, I will be redirected to /
  3. Given that I am a logged-in user and
    • When I navigate to questions that are not my own
    • Then I will not be able to delete the question

Editing Questions

  1. Given that I am a logged-in user and
    • When I am trying to edit a question with new words
    • I will be able to change the question title
  2. Given that I am a logged-in user and
    • When I am trying to edit a question with empty title
    • I will be shown “invalid question” error
  3. Given that I am a logged-out user and
    • When I am trying to edit a question
    • I will be shown “sign in” button at upper right corner

Getting Comments

  1. Given that I am a logged-out user and
    • When I click on the comments dropdown for an answer
    • I will be able to see all of the comments for that answer
  2. Given that I am a logged-in user and
    • When I click on the comments dropdown for an answer
    • I will be able to see all of the comments for that answer

Posting Comments

  1. Given that I am logged-in
    • I am on the specific question and answer / route
    • I will be able to write a comments for the answer on the specific question
  2. Given that I am not logged-in or created an account
    • I am on the question/ route
    • I won’t be able to click on the comments since I am not logged-in or haven’t created an account
    • The website will display a message stating that “Please log-in or create an account to write a comment.”
  3. Given that I logged-in and try to post a comment without writing anything
    • I am on the questions / route
    • When I try to post a comment without writing anything and click post, an error will display “Your comments are empty please write something in order to post it. :(“
  4. Given I post a comment and exceed the length of characters
    • I am on the questions / route and writing a comment
    • When it exceeds the amount of characters is given and when I click post, it will display an error message saying that the amount of characters I used are exceeding the limits.

Deleting Comments

  1. Given that I am a logged-out user and
    • When I navigate to a specific answer’s comment
    • Then I will be unable to delete the comment
  2. Given that I am a logged-in user and
    • When I navigate to a specific answer’s comment that is my own
    • Then I will be able to delete the comment, the comment will be deleted and I will not be redirected, I will still see the list of other comments
  3. Given that I am a logged-in user and
    • When I navigate to a specific answer’s comment that is not my own
    • Then I will not be able to delete the comment

Editing Comments

  1. Given that I am logged-in
    • When I am in the comment / route and click edit on my own comment
    • I will be able to edit my own comment and will appear once I finish editing the comment.
  2. Given that I am logged-out
    • When I am in the comment / route
    • I won’t be able to edit my own comment.

Getting Answers

  1. Given that I am a logged-out user and
    • When I click on the answers dropdown for a question
    • I will be able to see all of the answers for that question
  2. Given that I am a logged-in user and
    • When I click on the answers dropdown for an question
    • I will be able to see all of the answers for that question

Posting Answers

  1. Given that I’m not logged-in
    • I will not be able to post answers to any questions
  2. Given that I am logged in
    • I can post an answer to a question
    • When the answer is posted, it will appear under the question
  3. Given that when I try to post a answers without a answers
    • When I’m on the post answers / route and post a answers without an answers
    • The website will display an error message “Invalid post, the answer is empty, please enter your answer. :(
    • Error message will display “Invalid post, missing title and questions :(.
  4. Given that I haven’t created an account and try to post an answer
    • When I click on a specific questions
    • The website will display a message asking me to create an account in order to post an answer.

Deleting Answers

  1. Given that I’m not logged-in
    • I will not be able to delete other’s answers
  2. Given that I am logged-in
    • I will not be able to delete other’s answers
  3. I will be able to delete my own answers
    • After deleting an answer it will no longer appear under its parent question

Editing Answers

  1. Given that I am logged-in
    • When I click on the answer and direct to the answer / route
  2. I will see all the answers I answered and I will be able to choose the one I want to edit and edit it
    • Once I finished editing the answer, the new answer will appear on the question
  3. Given that I am logged-out
    • When I navigate and click on the answer button
    • The website will display a message says “You just log-in to your account in order to see or edit your answer”