Class: Minitest::Generators::MailerGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/minitest/mailer/mailer_generator.rb

Instance Method Summary collapse

Methods inherited from Base

default_source_root

Instance Method Details

#check_class_collisionObject


8
9
10
# File 'lib/generators/minitest/mailer/mailer_generator.rb', line 8

def check_class_collision
  class_collisions "#{class_name}Test", "#{class_name}Preview"
end

#create_preview_filesObject


22
23
24
# File 'lib/generators/minitest/mailer/mailer_generator.rb', line 22

def create_preview_files
  template "preview.rb", File.join("test/mailers/previews", class_path, "#{file_name}_preview.rb")
end

#create_test_filesObject


12
13
14
15
16
17
18
19
20
# File 'lib/generators/minitest/mailer/mailer_generator.rb', line 12

def create_test_files
  if options[:spec]
    template_file = "mailer_spec.rb"
  else
    template_file = "mailer_test.rb"
  end
  template template_file,
           File.join("test/mailers", class_path, "#{file_name}_test.rb")
end