Feature: Get a new password if lost In order to access NMK As a person who has lost their password I want to be able to get emailed a new password Scenario: Lost your password Given a user with email "test@test.com" And a clear email queue When I visit the home page And I follow "Lost password?" And I fill in "Your email address" with "test@test.com" And I press "Send a new password" # Check the email was sent Then "test@test.com" should receive 1 email # Now we want to make sure the login was actually reset When I visit the home page And I fill in "login_email" with "test@test.com" And I fill in "login_password" with "test" And I press "login" Then I should see "Password is incorrect" And I should not see "Hello" # Now try the content of the email When I visit the home page And "test@test.com" opens the email with subject "New password" And I fill in "login_email" with "test@test.com" And I enter the password from the email And I press "login" # Now we want to check we have returned to the home page Then I should see "Hello" Scenario: Think you have lost your password, but not actually registered Given a user with email "test@test.com" And a clear email queue When I visit the home page And I follow "Lost password?" And I fill in "Your email address" with "wrong-password@test.com" And I press "Send a new password" # Check the email was sent Then I should see "Sorry, email address not found."