[rspec-users] Side Effects in Stories
cwdinfo at gmail.com
Tue Sep 11 02:25:40 EDT 2007
I have a story where the user resets the password [hey, this story
thing really rocks!]. It is expected that the password will change
and that the user will be redirected to a login screen. A side effect
is that the user will receive email with his/her new password.
Where I'm stuck is in ascertaining whether mail was generated.
Any thoughts on how this might be accomplished?
Story: Reset the Password
As a registered user
I want to be able to reset the password and have it emailed to me
And then I want to log in
Scenario: Reset password for an account
Given A valid account is given: joe at schmoe.com
When Resetting password for joe at schmoe.com
Then Password state should change in database joe at schmoe.com
And Registered user should be redirected to login screen
And Email should be sent to the registered user
And the new password should work :)
More information about the rspec-users