User Stories and Acceptance Criteria - StevenBarnett1/Group_Project GitHub Wiki
Log In
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
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 redirected to /
Given that I am a logged-in user
When I refresh the homepage at /
Then I will still be logged in
Given that I am a logged-out user
When I try to navigate to /
Then I will be redirected to /users/login
Registration
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
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”.
When I enter a valid username, password, and email
Then a user account will be created, automatically logged in, and redirected to /
Given that I am a logged in user
When I navigate to /users/register
Then I will be redirected to /
Getting Questions
Given that I am a logged-out user and
When I navigate to /
Then I will be able to see all of the questions
Given that I am a logged-in user and
When I navigate to /
Then I will be able to see all of the questions
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
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
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”
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
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 :(“
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 :(“
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
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
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 /
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
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
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
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
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
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
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
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.”
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. :(“
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
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
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
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
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.
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
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
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
Given that I’m not logged-in
I will not be able to post answers to any questions
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
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 :(.
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
Given that I’m not logged-in
I will not be able to delete other’s answers
Given that I am logged-in
I will not be able to delete other’s answers
I will be able to delete my own answers
After deleting an answer it will no longer appear under its parent question
Editing Answers
Given that I am logged-in
When I click on the answer and direct to the answer / route
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
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”