<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Oct 19, 2007, at 1:54 PM, s.ross wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV><DIV><DIV><DIV>On Oct 18, 2007, at 6:09 AM, Daniel N wrote:</DIV><BLOCKQUOTE type="cite"></BLOCKQUOTE><BR><BLOCKQUOTE type="cite"><DIV><SPAN class="gmail_quote">On 9/11/07, <B class="gmail_sendername">s.ross</B> <<A href="mailto:cwdinfo@gmail.com">cwdinfo@gmail.com</A>> wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I have a story where the user resets the password [hey, this story<BR>thing really rocks!]. It is expected that the password will change<BR>and that the user will be redirected to a login screen. A side effect<BR>is that the user will receive email with his/her new password. <BR><BR>Where I'm stuck is in ascertaining whether mail was generated.<BR><BR>Any thoughts on how this might be accomplished?<BR><BR>Thanks<BR><BR>-----------------<BR><BR>Story: Reset the Password<BR><BR> As a registered user <BR> I want to be able to reset the password and have it emailed to me<BR> And then I want to log in<BR><BR><BR>Scenario: Reset password for an account<BR><BR> Given A valid account is given: <A href="mailto:joe@schmoe.com"> joe@schmoe.com</A><BR><BR> When Resetting password for <A href="mailto:joe@schmoe.com">joe@schmoe.com</A><BR><BR> Then Password state should change in database <A href="mailto:joe@schmoe.com">joe@schmoe.com</A><BR> And Registered user should be redirected to login screen <BR> And Email should be sent to the registered user<BR> And the new password should work :)<BR>_______________________________________________</BLOCKQUOTE><DIV><BR>Hi s.ross <BR><BR>I know this was a while ago that you asked this question, but did you end up coming up with a solution? <BR><BR>-Daniel<BR></DIV></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>Nope, and embarrassingly, I took a different direction without preserving any traces of what I had been doing (can you say "frequent checkins?"). Ooops. Everything but verifying that the email was sent was running, but I never figured out how to verify that.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>--steve</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR></DIV><BR></DIV></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">rspec-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</A></DIV> </BLOCKQUOTE></DIV><BR><DIV>from my specs on restful_authentication's models/user_observer_spec.rb</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>context "A UserObserver" do</DIV><DIV> setup do</DIV><DIV> @user = mock('user')</DIV><DIV> @user_observer = UserObserver.instance</DIV><DIV> end</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> specify "should call UserNotifier.deliver_signup_notification on user creation" do</DIV><DIV> UserNotifier.should_receive(:deliver_signup_notification).with(@user)</DIV><DIV> @user.stub!(:pending?).and_return(true)</DIV><DIV> @user.stub!(:recently_activated?).and_return(false)</DIV><DIV> @user.stub!(:recently_forgot_password?).and_return(false)</DIV><DIV> @user_observer.after_save(@user)</DIV><DIV> end</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(sorry its in pre-1.0 format)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>of course, this checks whether the email gets sent, not whether it got delivered... :)<DIV><BR class="khtml-block-placeholder"></DIV><DIV>--linoj</DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV></BODY></HTML>