Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8521 (closed enhancement: incomplete)

Opened 1 year ago

Last modified 1 year ago

[PATCH] DRYing up controller tests and mailer tests using superclasses

Reported by: csshsh Assigned to: csshsh
Priority: normal Milestone: 1.x
Component: Railties Version: edge
Severity: normal Keywords: test
Cc:

Description

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

Attachments

test_superclasses.diff (11.2 kB) - added by csshsh on 05/30/07 17:15:29.

Change History

05/30/07 17:15:29 changed by csshsh

  • attachment test_superclasses.diff added.

05/30/07 17:50:18 changed by bitsweat

I'd like to see these as mixins rather than superclasses so folks can mix and match their behavior.

Also, it'd help to add TestCase.setup declarations as an extension in Active Support so we could eliminate the method_added junk.

05/30/07 17:53:38 changed by csshsh

  • summary changed from DRYing up controller tests and mailer tests using superclasses to [PATCH] DRYing up controller tests and mailer tests using superclasses.

06/22/07 22:01:23 changed by bitsweat

  • keywords set to test.
  • status changed from new to closed.
  • resolution set to incomplete.

also, ActionMailer::MailerTest -> ActionMailer::TestCase