Class: Rspec::Generators::MailerGenerator Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base ,
Rails::Generators::NamedBase
|
|
Instance Chain:
self,
Base ,
::RSpec::Rails::FeatureCheck ,
Rails::Generators::NamedBase
|
|
Inherits: |
Rspec::Generators::Base
|
Defined in: | rspec-rails/lib/generators/rspec/mailer/mailer_generator.rb |
Class Method Summary
Base
- Inherited
.configuration | Load configuration from |
.source_root |
Instance Method Summary
- #generate_fixtures_files Internal use only
- #generate_mailer_spec Internal use only
- #generate_preview_files Internal use only
Base
- Inherited
::RSpec::Rails::FeatureCheck
- Included
Instance Method Details
#generate_fixtures_files
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/mailer/mailer_generator.rb', line 15
def generate_fixtures_files actions.each do |action| @action, @path = action, File.join(file_path, action) template "fixture", target_path("fixtures", @path) end end
#generate_mailer_spec
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/mailer/mailer_generator.rb', line 10
def generate_mailer_spec file_suffix = file_name.end_with?('mailer') ? 'spec.rb' : 'mailer_spec.rb' template "mailer_spec.rb", target_path('mailers', class_path, [file_name, file_suffix].join('_')) end
#generate_preview_files
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/mailer/mailer_generator.rb', line 22
def generate_preview_files return unless RSpec::Rails::FeatureCheck.has_action_mailer_preview? file_suffix = file_name.end_with?('mailer') ? 'preview.rb' : 'mailer_preview.rb' template "preview.rb", target_path("mailers/previews", class_path, [file_name, file_suffix].join('_')) end