Created
October 26, 2012 04:23
-
-
Save joshsmith/3956800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| feature 'Reset password' do | |
| attr_accessor :current_email_address | |
| scenario 'Successful password reset' do | |
| user = create(:user) | |
| original_password = user.password | |
| visit '/signin' | |
| click_link "Forgot your password?" | |
| fill_in "Email", :with => user.email | |
| click_button "Send me reset password instructions" | |
| self.current_email_address = user.email | |
| unread_emails_for(user.email).should be_present | |
| open_email user.email, :with_subject => "Reset password instructions" | |
| click_first_link_in_email | |
| page.should have_content("Change your password") | |
| fill_in "New password", :with => "newpassword" | |
| fill_in "Confirm new password", :with => "newpassword" | |
| click_button "Change my password" | |
| page.should have_content("Your password was changed successfully. You are now signed in.") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment