test/test_mailer_generator.rb in padrino-gen-0.2.9 vs test/test_mailer_generator.rb in padrino-gen-0.4.5
- old
+ new
@@ -39,6 +39,18 @@
assert_match_in_file(/Padrino::Mailer::Base.smtp_settings/m, '/tmp/sample_app/config/initializers/mailer.rb')
assert_file_exists('/tmp/sample_app/app/views/demo_mailer')
end
end
+ context "the mailer destroy option" do
+
+ should "destroy mailer file" do
+ silence_logger { @app.start(['sample_app', '/tmp', '--script=none', '-t=bacon']) }
+ silence_logger { @mailgen.start(['demo', '-r=/tmp/sample_app']) }
+ silence_logger { @mailgen.start(['demo', '-r=/tmp/sample_app','-d']) }
+ assert_no_dir_exists('/tmp/sample_app/app/views/demo_mailer')
+ assert_no_file_exists('/tmp/sample_app/app/mailers/demo_mailer.rb')
+ assert_no_file_exists('/tmp/sample_app/config/initializers/mailer.rb')
+ end
+ end
+
end