diff --git a/features/password_reset.feature b/features/password_reset.feature deleted file mode 100644 index 51b77f7..0000000 --- a/features/password_reset.feature +++ /dev/null @@ -1,33 +0,0 @@ -Feature: Password reset - In order to sign in even if user forgot their password - A user - Should be able to reset it - - Scenario: User is not signed up - Given no user exists with an email of "email@person.com" - When I request password reset link to be sent to "email@person.com" - Then I should see "Unknown email" - - Scenario: User is signed up and requests password reset - Given I signed up with "email@person.com/password" - When I request password reset link to be sent to "email@person.com" - Then I should see "instructions for changing your password" - And a password reset message should be sent to "email@person.com" - - Scenario: User is signed up updated his password and types wrong confirmation - Given I signed up with "email@person.com/password" - When I follow the password reset link sent to "email@person.com" - And I update my password with "newpassword/wrongconfirmation" - Then I should see error messages - And I should be signed out - - Scenario: User is signed up and updates his password - Given I signed up with "email@person.com/password" - When I follow the password reset link sent to "email@person.com" - And I update my password with "newpassword/newpassword" - Then I should be signed in - When I sign out - Then I should be signed out - And I sign in as "email@person.com/newpassword" - Then I should be signed in - diff --git a/features/sign_in.feature b/features/sign_in.feature deleted file mode 100644 index 4b44c39..0000000 --- a/features/sign_in.feature +++ /dev/null @@ -1,42 +0,0 @@ -Feature: Sign in - In order to get access to protected sections of the site - A user - Should be able to sign in - - Scenario: User is not signed up - Given no user exists with an email of "email@person.com" - When I go to the sign in page - And I sign in as "email@person.com/password" - Then I should see "Bad email or password" - And I should be signed out - - Scenario: User is not confirmed - Given I signed up with "email@person.com/password" - When I go to the sign in page - And I sign in as "email@person.com/password" - Then I should see "User has not confirmed email" - And I should be signed out - - Scenario: User enters wrong password - Given I am signed up and confirmed as "email@person.com/password" - When I go to the sign in page - And I sign in as "email@person.com/wrongpassword" - Then I should see "Bad email or password" - And I should be signed out - - Scenario: User signs in successfully - Given I am signed up and confirmed as "email@person.com/password" - When I go to the sign in page - And I sign in as "email@person.com/password" - Then I should see "Signed in" - And I should be signed in - - Scenario: User signs in and checks "remember me" - Given I am signed up and confirmed as "email@person.com/password" - When I go to the sign in page - And I sign in with "remember me" as "email@person.com/password" - Then I should see "Signed in" - And I should be signed in - When I return next time - Then I should be signed in - diff --git a/features/sign_out.feature b/features/sign_out.feature deleted file mode 100644 index 2107226..0000000 --- a/features/sign_out.feature +++ /dev/null @@ -1,23 +0,0 @@ -Feature: Sign out - To protect my account from unauthorized access - A signed in user - Should be able to sign out - - Scenario: User signs out - Given I am signed up and confirmed as "email@person.com/password" - When I sign in as "email@person.com/password" - Then I should be signed in - And I sign out - Then I should see "Signed out" - And I should be signed out - - Scenario: User who was remembered signs out - Given I am signed up and confirmed as "email@person.com/password" - When I sign in with "remember me" as "email@person.com/password" - Then I should be signed in - And I sign out - Then I should see "Signed out" - And I should be signed out - When I return next time - Then I should be signed out - diff --git a/features/sign_up.feature b/features/sign_up.feature deleted file mode 100644 index dd4269c..0000000 --- a/features/sign_up.feature +++ /dev/null @@ -1,28 +0,0 @@ -Feature: Sign up - In order to get access to protected sections of the site - A user - Should be able to sign up - - Scenario: User signs up with invalid data - When I go to the sign up page - And I fill in "Email" with "invalidemail" - And I fill in "Password" with "password" - And I fill in "Password confirmation" with "" - And I press "Sign Up" - Then I should see error messages - - Scenario: User signs up with valid data - When I go to the sign up page - And I fill in "Email" with "email@person.com" - And I fill in "Password" with "password" - And I fill in "Password confirmation" with "password" - And I press "Sign Up" - Then I should see "instructions for confirming" - And a confirmation message should be sent to "email@person.com" - - Scenario: User confirms his account - Given I signed up with "email@person.com/password" - When I follow the confirmation link sent to "email@person.com" - Then I should see "Confirmed email and signed in" - And I should be signed in - diff --git a/features/users/.keep b/features/users/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/features/users/.keep diff --git a/features/users/password_reset.feature b/features/users/password_reset.feature new file mode 100644 index 0000000..51b77f7 --- /dev/null +++ b/features/users/password_reset.feature @@ -0,0 +1,33 @@ +Feature: Password reset + In order to sign in even if user forgot their password + A user + Should be able to reset it + + Scenario: User is not signed up + Given no user exists with an email of "email@person.com" + When I request password reset link to be sent to "email@person.com" + Then I should see "Unknown email" + + Scenario: User is signed up and requests password reset + Given I signed up with "email@person.com/password" + When I request password reset link to be sent to "email@person.com" + Then I should see "instructions for changing your password" + And a password reset message should be sent to "email@person.com" + + Scenario: User is signed up updated his password and types wrong confirmation + Given I signed up with "email@person.com/password" + When I follow the password reset link sent to "email@person.com" + And I update my password with "newpassword/wrongconfirmation" + Then I should see error messages + And I should be signed out + + Scenario: User is signed up and updates his password + Given I signed up with "email@person.com/password" + When I follow the password reset link sent to "email@person.com" + And I update my password with "newpassword/newpassword" + Then I should be signed in + When I sign out + Then I should be signed out + And I sign in as "email@person.com/newpassword" + Then I should be signed in + diff --git a/features/users/sign_in.feature b/features/users/sign_in.feature new file mode 100644 index 0000000..4b44c39 --- /dev/null +++ b/features/users/sign_in.feature @@ -0,0 +1,42 @@ +Feature: Sign in + In order to get access to protected sections of the site + A user + Should be able to sign in + + Scenario: User is not signed up + Given no user exists with an email of "email@person.com" + When I go to the sign in page + And I sign in as "email@person.com/password" + Then I should see "Bad email or password" + And I should be signed out + + Scenario: User is not confirmed + Given I signed up with "email@person.com/password" + When I go to the sign in page + And I sign in as "email@person.com/password" + Then I should see "User has not confirmed email" + And I should be signed out + + Scenario: User enters wrong password + Given I am signed up and confirmed as "email@person.com/password" + When I go to the sign in page + And I sign in as "email@person.com/wrongpassword" + Then I should see "Bad email or password" + And I should be signed out + + Scenario: User signs in successfully + Given I am signed up and confirmed as "email@person.com/password" + When I go to the sign in page + And I sign in as "email@person.com/password" + Then I should see "Signed in" + And I should be signed in + + Scenario: User signs in and checks "remember me" + Given I am signed up and confirmed as "email@person.com/password" + When I go to the sign in page + And I sign in with "remember me" as "email@person.com/password" + Then I should see "Signed in" + And I should be signed in + When I return next time + Then I should be signed in + diff --git a/features/users/sign_out.feature b/features/users/sign_out.feature new file mode 100644 index 0000000..2107226 --- /dev/null +++ b/features/users/sign_out.feature @@ -0,0 +1,23 @@ +Feature: Sign out + To protect my account from unauthorized access + A signed in user + Should be able to sign out + + Scenario: User signs out + Given I am signed up and confirmed as "email@person.com/password" + When I sign in as "email@person.com/password" + Then I should be signed in + And I sign out + Then I should see "Signed out" + And I should be signed out + + Scenario: User who was remembered signs out + Given I am signed up and confirmed as "email@person.com/password" + When I sign in with "remember me" as "email@person.com/password" + Then I should be signed in + And I sign out + Then I should see "Signed out" + And I should be signed out + When I return next time + Then I should be signed out + diff --git a/features/visitors/.keep b/features/visitors/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/features/visitors/.keep diff --git a/features/visitors/sign_up.feature b/features/visitors/sign_up.feature new file mode 100644 index 0000000..dd4269c --- /dev/null +++ b/features/visitors/sign_up.feature @@ -0,0 +1,28 @@ +Feature: Sign up + In order to get access to protected sections of the site + A user + Should be able to sign up + + Scenario: User signs up with invalid data + When I go to the sign up page + And I fill in "Email" with "invalidemail" + And I fill in "Password" with "password" + And I fill in "Password confirmation" with "" + And I press "Sign Up" + Then I should see error messages + + Scenario: User signs up with valid data + When I go to the sign up page + And I fill in "Email" with "email@person.com" + And I fill in "Password" with "password" + And I fill in "Password confirmation" with "password" + And I press "Sign Up" + Then I should see "instructions for confirming" + And a confirmation message should be sent to "email@person.com" + + Scenario: User confirms his account + Given I signed up with "email@person.com/password" + When I follow the confirmation link sent to "email@person.com" + Then I should see "Confirmed email and signed in" + And I should be signed in + -- libgit2 0.21.2