Hi! I want to write an accept test for our user account activation emails, that is to have a plain txt file with the email is properly formatted with all the test data in place and then maka a diff with the email produced by the code.
My problem is that authlogic renders a perishable_token for the user that is random (very good in production, not so much in tests), that I can't seem to mock. In the Mailer object i have @activate_account_link = register_url(@user.perishable_token) and for my tests I want @activate_account_link to be deterministic. I have tried allow().to and let, but I am new to this, and I can not make them work. As for now I have monkey patched register_url to be overloaded in my mailer object (it is part of Authlogic) for the tests, but it does not feel right. Has anyone any experience with testing things like this? What type of mocking/stubing is the correct approach? Thank you beforehand. Ester Ytterbrink -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/7a23552d-ac55-4082-ba9f-6856c2fb256e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
