A website template with lots of features, built with ruby on rails.

user_account.feature 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @user_account
  2. Feature: User Account
  3. In order to change content in the website
  4. As user of the system
  5. I want to create, update adn delete my user account
  6. Background:
  7. Given the website is configured
  8. Scenario: Registered user login
  9. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  10. And I am not logged in
  11. When I go to the login page
  12. Then I should see "Sign In"
  13. And I log in with the email "monty_cantsin@canada.com" and password "12345678"
  14. Then I should see "Signed in successfully"
  15. And I should see "Monty Cantsin"
  16. And I should see "Logout"
  17. Scenario: Registered user logout
  18. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  19. And I am not logged in
  20. When I go to the login page
  21. And I log in with the email "monty_cantsin@canada.com" and password "12345678"
  22. Then I click in the link "Logout"
  23. And I should see "Signed out successfully"
  24. Scenario: User registration
  25. Given I am not logged in
  26. And I go to the signup page
  27. When I fill in "First Name" with "Monty"
  28. And I fill in "Last Name" with "Cantsin"
  29. And I fill in "Email" with "monty_cantsin@canada.com"
  30. And I fill in "Password" with "12345678"
  31. And I fill in "Password Confirmation" with "12345678"
  32. And I submit the login form
  33. Then I should see "Welcome! You have signed up successfully"
  34. And I should see "Monty Cantsin"
  35. And I should see "Logout"
  36. And "monty_cantsin@canada.com" should receive an email with subject "Welcome to Rails Website Template"
  37. Scenario: User forgets password
  38. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  39. And I am not logged in
  40. And I go to the login page
  41. When I click in the link "Forgot your password?"
  42. And I fill in "Email" with "monty_cantsin@canada.com"
  43. And I submit the password reset form
  44. Then I should see "You will receive an email with instructions on how to reset your password in a few minutes"
  45. And "monty_cantsin@canada.com" should receive an email with subject "Reset password instructions"
  46. When I open the email with subject "Reset password instructions"
  47. Then I should see "Someone has requested a link to change your password" in the email body
  48. Then I clicks in the link "Change my password" in the email
  49. And I fill in "New Password" with "87654321"
  50. And I fill in "Confirm New Password" with "87654321"
  51. And I submit the new password form
  52. Then I should see "Your password was changed successfully. You are now signed in."
  53. And I should see "Monty Cantsin"
  54. And I should see "Logout"
  55. Scenario: Change user name and email
  56. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  57. And I go to the login page
  58. And I log in with the email "monty_cantsin@canada.com" and password "12345678"
  59. And I go to the homepage
  60. When I click in the link "Account"
  61. Then I should see "Edit Profile"
  62. And I fill in "First Name" with "Donald"
  63. And I fill in "Last Name" with "Duck"
  64. And I fill in "Email" with "donald_duck@looneytunes.com"
  65. And I fill in "Current Password" with "12345678"
  66. And I click in the button "Update"
  67. Then I should see "You updated your account successfully"
  68. Then I should see "Donald Duck"
  69. Scenario: Change user password
  70. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  71. And I go to the login page
  72. And I log in with the email "monty_cantsin@canada.com" and password "12345678"
  73. And I go to the homepage
  74. When I click in the link "Account"
  75. And I fill in "Password" with "87654321"
  76. And I fill in "Password Confirmation" with "87654321"
  77. And I fill in "Current Password" with "12345678"
  78. And I click in the button "Update"
  79. Then I should see "You updated your account successfully"
  80. And I click in the link "Logout"
  81. And I go to the login page
  82. And I log in with the email "monty_cantsin@canada.com" and password "87654321"
  83. Then I should see "Signed in successfully"
  84. Scenario: Change User Avatar
  85. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  86. And I go to the login page
  87. And I log in with the email "monty_cantsin@canada.com" and password "12345678"
  88. And I click in the link "Account"
  89. When I upload the file "avatar.jpg" to the field "user_avatar"
  90. And I click in the button "Update"
  91. And I click in the link "Account"
  92. Then I should see the image "avatar.jpg"
  93. Scenario: Delete user account
  94. Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" and password "12345678" exists
  95. And I go to the login page
  96. And I log in with the email "monty_cantsin@canada.com" and password "12345678"
  97. And I click in the link "Account"
  98. When I click in the link "Delete Account"
  99. Then I should see "Bye! Your account was successfully cancelled. We hope to see you again soon."