Skip to content

Commit

Permalink
add test_helper to prepare for multiple test files
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbriones committed Apr 9, 2010
1 parent 6c9a4d8 commit cce91d9
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 74 deletions.
75 changes: 1 addition & 74 deletions test/mad_mimi_mailer_test.rb
@@ -1,77 +1,4 @@
require "rubygems"
require "test/unit"
require "mocha"

require "mad_mimi_mailer"

MadMimiMailer.api_settings = {
:username => "testy@mctestin.com",
:api_key => "w00tb4r"
}

class MadMimiMailer
self.template_root = File.dirname(__FILE__) + '/templates/'

def mimi_hola(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
bcc ["Gregg Pollack <gregg@example.com>", "David Clymer <david@example>"]
promotion "hello"
body :message => greeting
end

def mimi_hello(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
bcc ["Gregg Pollack <gregg@example.com>", "David Clymer <david@example>"]
body :message => greeting
end

def mimi_hello_erb(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
promotion "w00t"
use_erb true
body :message => greeting
end

def mimi_multipart_hello_erb(greeting)
subject greeting
recipients "sandro@hashrocket.com"
from "stephen@hashrocket.com"
promotion "w00t"
use_erb true
body :message => greeting
end

def mimi_bye_erb(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
promotion "w00t"
use_erb true
body :message => greeting
end

def mimi_hello_sans_bcc(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
body :message => greeting
end

def mimi_unconfirmed(greeting)
subject greeting
recipients 'egunderson@obtiva.com'
from 'mimi@obtiva.com'
promotion 'woot'
body :message => greeting
unconfirmed true
end
end
require File.expand_path(File.dirname(__FILE__) + '/test_helper')

class TestMadMimiMailer < Test::Unit::TestCase

Expand Down
74 changes: 74 additions & 0 deletions test/test_helper.rb
@@ -0,0 +1,74 @@
require "rubygems"
require "test/unit"
require "mocha"

require "mad_mimi_mailer"

MadMimiMailer.api_settings = {
:username => "testy@mctestin.com",
:api_key => "w00tb4r"
}

class MadMimiMailer
self.template_root = File.dirname(__FILE__) + '/templates/'

def mimi_hola(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
bcc ["Gregg Pollack <gregg@example.com>", "David Clymer <david@example>"]
promotion "hello"
body :message => greeting
end

def mimi_hello(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
bcc ["Gregg Pollack <gregg@example.com>", "David Clymer <david@example>"]
body :message => greeting
end

def mimi_hello_erb(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
promotion "w00t"
use_erb true
body :message => greeting
end

def mimi_multipart_hello_erb(greeting)
subject greeting
recipients "sandro@hashrocket.com"
from "stephen@hashrocket.com"
promotion "w00t"
use_erb true
body :message => greeting
end

def mimi_bye_erb(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
promotion "w00t"
use_erb true
body :message => greeting
end

def mimi_hello_sans_bcc(greeting)
subject greeting
recipients "tyler@obtiva.com"
from "dave@obtiva.com"
body :message => greeting
end

def mimi_unconfirmed(greeting)
subject greeting
recipients 'egunderson@obtiva.com'
from 'mimi@obtiva.com'
promotion 'woot'
body :message => greeting
unconfirmed true
end
end

0 comments on commit cce91d9

Please sign in to comment.