Florian Weber
2007-May-30 17:24 UTC
DRYing up controller tests and mailer tests using superclasses
Hi! Currently both, the controller/functional tests and mailer tests, contain a lot of cruft. I''ve created two superclasses to DRY them up a bit. Here are some examples how tests using those superclasses will look: http://pastie.caboo.se/66139 Ticket with the patch: http://dev.rubyonrails.org/ticket/8521 Known issues: * Since we don''t explicitly setup the @request and @response objects anymore, we should probably show how to use them in the dummy test_foo method. Could be something like: def test_foo @request.host = "foo.bar.com" assert true ... end * The creation of the method_added-method in ControllerTest and MailerTest should probably be DRYed up and put into RailsTest. In any case, feedback on this is appreciated. Thanks! Ciao! Florian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---