From 49ceb1c7acdd09cc77eb6c9ab0ab79f927a3fe41 Mon Sep 17 00:00:00 2001 From: Luke Redpath Date: Fri, 9 Oct 2009 12:17:39 +0100 Subject: [PATCH] Failing features for resetting email. --- features/email_reset.feature | 36 +++++++++++++++++++ .../step_definitions/email_reset_steps.rb | 11 ++++++ 2 files changed, 47 insertions(+) create mode 100644 features/email_reset.feature create mode 100644 features/step_definitions/email_reset_steps.rb diff --git a/features/email_reset.feature b/features/email_reset.feature new file mode 100644 index 00000000000..1eb3c43a282 --- /dev/null +++ b/features/email_reset.feature @@ -0,0 +1,36 @@ +@wip +Feature: Email reset + In order to still use my account after I've changed my email address + A user + Should be able to reset the email address associated with my account + + Scenario: User resets email address + Given I have signed in with "email@person.com/password" + And I am on my edit profile page + When I fill in "Email address" with "email@newperson.com" + And I press "Reset email address" + Then an email entitled "Confirm your email address" should be sent to "email@newperson.com" + And I should be signed out + + Scenario: User confirms new email address + Given I have signed in with "email@person.com/password" + And I have reset my email address to "email@newperson.com" + And I follow the confirmation link sent to "email@newperson.com" + Then I should see the message "Your email address has been confirmed" + And I should be signed in + + Scenario: User tries to sign in in after resetting email address without confirmation + Given I have signed in with "email@person.com/password" + And I have reset my email address to "email@newperson.com" + When I sign in as "email@newperson.com/password" + Then I should be forbidden + + Scenario: User signs in after resetting and confirming email address + Given I have signed in with "email@person.com/password" + And I have reset my email address to "email@newperson.com" + And I follow the confirmation link sent to "email@newperson.com" + When I return next time + And I sign in as "email@newperson.com/password" + Then I should be signed in + + \ No newline at end of file diff --git a/features/step_definitions/email_reset_steps.rb b/features/step_definitions/email_reset_steps.rb new file mode 100644 index 00000000000..5f3e1e21f40 --- /dev/null +++ b/features/step_definitions/email_reset_steps.rb @@ -0,0 +1,11 @@ +Then /^I should receive an email entitled "([^\"]*)"$/ do |arg1| + pending +end + +Given /^I have reset my email address to "([^\"]*)"$/ do |arg1| + pending +end + +Then /^I should see the message "([^\"]*)"$/ do |arg1| + pending +end