Class: ActionMailer::TestCase

Inherits:
ActiveSupport::TestCase
  • Object
show all
Includes:
TestHelper, Quoting
Defined in:
lib/action_mailer/test_case.rb

Class Method Summary collapse

Methods included from TestHelper

#assert_emails, #assert_no_emails

Class Method Details

.determine_default_mailer(name) ⇒ Object



31
32
33
34
35
# File 'lib/action_mailer/test_case.rb', line 31

def determine_default_mailer(name)
  name.sub(/Test$/, '').constantize
rescue NameError => e
  raise NonInferrableMailerError.new(name)
end

.mailer_classObject



23
24
25
26
27
28
29
# File 'lib/action_mailer/test_case.rb', line 23

def mailer_class
  if mailer = read_inheritable_attribute(:mailer_class)
    mailer
  else
    tests determine_default_mailer(name)
  end
end

.tests(mailer) ⇒ Object



19
20
21
# File 'lib/action_mailer/test_case.rb', line 19

def tests(mailer)
  write_inheritable_attribute(:mailer_class, mailer)
end