test/test_mailer_generator.rb in padrino-gen-0.9.6 vs test/test_mailer_generator.rb in padrino-gen-0.9.7

- old
+ new

@@ -18,10 +18,11 @@ should "support generating a new mailer extended from base" do silence_logger { @project.start(['sample_project', '--root=/tmp', '--script=none', '-t=bacon']) } silence_logger { @mail_gen.start(['demo', '-r=/tmp/sample_project']) } assert_match_in_file(/class DemoMailer < Padrino::Mailer::Base/m, '/tmp/sample_project/app/mailers/demo_mailer.rb') assert_match_in_file(/Padrino::Mailer::Base.smtp_settings/m, '/tmp/sample_project/lib/mailer.rb') + assert_match_in_file(/register MailerInitializer/m, '/tmp/sample_project/app/app.rb') assert_file_exists('/tmp/sample_project/app/views/demo_mailer') end should "support generating a new mailer extended from base with long name" do silence_logger { @project.start(['sample_project', '--root=/tmp', '--script=none', '-t=bacon']) } @@ -36,13 +37,14 @@ silence_logger { @mail_gen.start(['DEMO', '-r=/tmp/sample_project']) } assert_match_in_file(/class DemoMailer < Padrino::Mailer::Base/m, '/tmp/sample_project/app/mailers/demo_mailer.rb') assert_match_in_file(/Padrino::Mailer::Base.smtp_settings/m, '/tmp/sample_project/lib/mailer.rb') assert_file_exists('/tmp/sample_project/app/views/demo_mailer') end + end context "the mailer destroy option" do - + should "destroy mailer file" do silence_logger { @project.start(['sample_project', '--root=/tmp', '--script=none', '-t=bacon']) } silence_logger { @mail_gen.start(['demo', '-r=/tmp/sample_project']) } silence_logger { @mail_gen.start(['demo', '-r=/tmp/sample_project','-d']) } assert_no_dir_exists('/tmp/sample_project/app/views/demo_mailer')